Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: ui/views/widget/widget.h

Issue 10834079: views: Extract Widget observer into its own header file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/views.gyp ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/widget.h
diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h
index 6df205ee1d06f41fef402d79a263c6e353f59c77..a96e4c82e31d49687012b4b429529245d38a027d 100644
--- a/ui/views/widget/widget.h
+++ b/ui/views/widget/widget.h
@@ -49,7 +49,6 @@ class OSExchangeData;
class ThemeProvider;
enum TouchStatus;
}
-using ui::ThemeProvider;
namespace views {
@@ -60,6 +59,8 @@ class NonClientFrameView;
class ScopedEvent;
class View;
class WidgetDelegate;
+class WidgetObserver;
+
namespace internal {
class NativeWidgetPrivate;
class RootView;
@@ -93,17 +94,6 @@ class RootView;
class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
public FocusTraversable {
public:
- // Observers can listen to various events on the Widgets.
- class VIEWS_EXPORT Observer {
- public:
- virtual void OnWidgetClosing(Widget* widget) {}
- virtual void OnWidgetVisibilityChanged(Widget* widget, bool visible) {}
- virtual void OnWidgetActivationChanged(Widget* widget, bool active) {}
- virtual void OnWidgetMoved(Widget* widget) {}
- protected:
- virtual ~Observer() {}
- };
-
typedef std::set<Widget*> Widgets;
enum FrameType {
@@ -271,9 +261,9 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
gfx::NativeWindow GetNativeWindow() const;
// Add/remove observer.
- void AddObserver(Observer* observer);
- void RemoveObserver(Observer* observer);
- bool HasObserver(Observer* observer);
+ void AddObserver(WidgetObserver* observer);
+ void RemoveObserver(WidgetObserver* observer);
+ bool HasObserver(WidgetObserver* observer);
// Returns the accelerator given a command id. Returns false if there is
// no accelerator associated with a given id, which is a common condition.
@@ -429,7 +419,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
bool IsAccessibleWidget() const;
// Returns the ThemeProvider that provides theme resources for this Widget.
- virtual ThemeProvider* GetThemeProvider() const;
+ virtual ui::ThemeProvider* GetThemeProvider() const;
// Returns the FocusManager for this widget.
// Note that all widgets in a widget hierarchy share the same focus manager.
@@ -577,7 +567,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
// Sets capture to the specified view. This makes it so that all mouse, touch
// and gesture events go to |view|.
- void SetCapture(views::View* view);
+ void SetCapture(View* view);
// Releases capture.
void ReleaseCapture();
@@ -711,7 +701,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
internal::NativeWidgetPrivate* native_widget_;
- ObserverList<Observer> observers_;
+ ObserverList<WidgetObserver> observers_;
// Non-owned pointer to the Widget's delegate. May be NULL if no delegate is
// being used.
« no previous file with comments | « ui/views/views.gyp ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698