diff options
author | glotov@google.com <glotov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 15:09:06 +0000 |
---|---|---|
committer | glotov@google.com <glotov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 15:09:06 +0000 |
commit | b2b7180173280cecff7219287f1e9895ce51b0c8 (patch) | |
tree | b35d9ae10df803745e4b498ad5c019494a6f722d /views | |
parent | 3ae5bab014f04b9e19c43f2e955c16d340df6fa6 (diff) | |
download | chromium_src-b2b7180173280cecff7219287f1e9895ce51b0c8.zip chromium_src-b2b7180173280cecff7219287f1e9895ce51b0c8.tar.gz chromium_src-b2b7180173280cecff7219287f1e9895ce51b0c8.tar.bz2 |
Virtual LocaleChanged() callback added to views hierarchy to notify
views of the locale change so they could reload relevant data.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1145003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42614 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/view.cc | 8 | ||||
-rw-r--r-- | views/view.h | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/views/view.cc b/views/view.cc index a03378e..c5359a7 100644 --- a/views/view.cc +++ b/views/view.cc @@ -647,11 +647,15 @@ void View::PropagateAddNotifications(View* parent, View* child) { } void View::ThemeChanged() { - int c = GetChildViewCount(); - for (int i = c - 1; i >= 0; --i) + for (int i = GetChildViewCount() - 1; i >= 0; --i) GetChildViewAt(i)->ThemeChanged(); } +void View::LocaleChanged() { + for (int i = GetChildViewCount() - 1; i >= 0; --i) + GetChildViewAt(i)->LocaleChanged(); +} + #ifndef NDEBUG bool View::IsProcessingPaint() const { return GetParent() && GetParent()->IsProcessingPaint(); diff --git a/views/view.h b/views/view.h index f2469f7..29cd1a9 100644 --- a/views/view.h +++ b/views/view.h @@ -982,6 +982,12 @@ class View : public AcceleratorTarget { // call this method on the RootView. 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(); + #ifndef NDEBUG // Returns true if the View is currently processing a paint. virtual bool IsProcessingPaint() const; |