diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-24 20:39:58 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-24 20:39:58 +0000 |
commit | 56235c632f18380a4455b6ea113cd6e2a2df0d69 (patch) | |
tree | 82150c0c7f8bb6c2c80c5580c56c9772059aa92f /views/widget/widget.h | |
parent | 64b29caf448b26c316533dbd98efbdc92f6163bd (diff) | |
download | chromium_src-56235c632f18380a4455b6ea113cd6e2a2df0d69.zip chromium_src-56235c632f18380a4455b6ea113cd6e2a2df0d69.tar.gz chromium_src-56235c632f18380a4455b6ea113cd6e2a2df0d69.tar.bz2 |
Move some more direct uses of RootView to Widget.
The idea is to remove RootView from the public API of Views and eventually move it into the internal namespace. It is really an implementation detail of event propagation into a view hierarchy.
Anyone that calls GetRootView() and does something that isn't a View method should be calling that method on the Widget instead...
e.g. instead of calling GetRootView()->NotifyThemeChanged(), call GetWidget()->ThemeChanged().
The RootView is a focus traversable, which is fine, but calling code should call GetWidget()->GetFocusTraversable() to obtain it, rather than knowing RootView is-a focus traversable and just calling GetRootView().
This also changes FocusManager::ContainsView to be simpler and cross platform. Since there is one FocusManager per view hierarchy (attached to the toplevel Widget), getting the view's focus manager and comparing it to the current focus manager is a sufficient test.
BUG=72040
TEST=existing unittests, none
Review URL: http://codereview.chromium.org/6577017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75940 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget/widget.h')
-rw-r--r-- | views/widget/widget.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/views/widget/widget.h b/views/widget/widget.h index 344c26a..2e12a74 100644 --- a/views/widget/widget.h +++ b/views/widget/widget.h @@ -26,6 +26,7 @@ using ui::ThemeProvider; namespace views { class FocusManager; +class FocusTraversable; class RootView; class TooltipManager; class View; @@ -241,6 +242,17 @@ class Widget { virtual void SchedulePaintInRect(const gfx::Rect& rect) = 0; virtual void SetCursor(gfx::NativeCursor cursor) = 0; + + // Retrieves the focus traversable for this widget. + virtual FocusTraversable* GetFocusTraversable() = 0; + + // Notifies the view hierarchy contained in this widget that theme resources + // changed. + virtual void ThemeChanged() = 0; + + // Notifies the view hierarchy contained in this widget that locale resources + // changed. + virtual void LocaleChanged() = 0; }; } // namespace views |