UI Language switch implemented by propagating LocaleChanged()
notification to all the views currently active.
Before this CL, all views were recreated instead. That was very refactoring-unsafe.
Note, this is first part of the change. It prepares overall architecture means and can be committed first.
The other part contains implementation details and is here: http://codereview.chromium.org/1551029/show
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1596023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45057 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/views/view.h b/views/view.h
index d8177aa..bdf1b232 100644
--- a/views/view.h
+++ b/views/view.h
@@ -982,10 +982,8 @@
virtual void ThemeChanged();
// Called when the locale has changed, overriding allows individual Views to
- // update locale-dependent resources (strings, bitmaps) it may have cached
- // internally. Subclasses that override this method must call the base class
- // implementation to ensure child views are processed.
- virtual void LocaleChanged();
+ // update locale-dependent strings.
+ virtual void LocaleChanged() { }
#ifndef NDEBUG
// Returns true if the View is currently processing a paint.
@@ -1125,6 +1123,10 @@
gfx::Point start_pt;
};
+ // Propagates locale changed notification from the root view downside.
+ // Invokes LocaleChanged() for every view in the hierarchy.
+ virtual void NotifyLocaleChanged();
+
// RootView invokes these. These in turn invoke the appropriate OnMouseXXX
// method. If a drag is detected, DoDrag is invoked.
bool ProcessMousePressed(const MouseEvent& e, DragInfo* drop_info);