Index: ui/display/desktop_observer.h |
diff --git a/ui/display/desktop_observer.h b/ui/display/desktop_observer.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ac9c87b44a01b3b4fe3778c0adf76d61fdd7bc2f |
--- /dev/null |
+++ b/ui/display/desktop_observer.h |
@@ -0,0 +1,37 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_DISPLAY_DESKTOP_OBSERVER_H_ |
+#define UI_DISPLAY_DESKTOP_OBSERVER_H_ |
+ |
+#include <string> |
+ |
+#include "ui/display/display_export.h" |
+ |
+namespace display { |
+ |
+namespace desktop { |
sky
2016/06/29 22:55:58
Don't use desktop here. See threads on namespace u
danakj
2016/06/29 22:56:51
Can you point at a thread? The google style guide
Tom (Use chromium acct)
2016/06/29 23:24:20
I'll hold off on making this change until sky/dana
Tom (Use chromium acct)
2016/06/29 23:24:20
Do you mean to create a display::Desktop class to
sky
2016/06/30 00:25:55
Sorry for not being clear. I meant the later, nuke
Tom (Use chromium acct)
2016/06/30 17:35:53
Done.
|
+ |
+// Observers for desktop configuration changes. |
+class DISPLAY_EXPORT DesktopObserver { |
sky
2016/06/29 22:55:58
Is there a reason you didn't add this to DisplayOb
Tom (Use chromium acct)
2016/06/29 23:24:20
I did that originally, but the desktop::Screen ins
sky
2016/06/30 00:25:55
Can you move initialization earlier?
Tom (Use chromium acct)
2016/06/30 17:35:53
If you really want, I can move it back into Displa
|
+ public: |
+ // Called when the (platform-specific) workspace ID changes to |
+ // |new_workspace|. |
+ virtual void OnWorkspaceChanged(const std::string& new_workspace) = 0; |
+ |
+ protected: |
+ virtual ~DesktopObserver(); |
+}; |
+ |
+DISPLAY_EXPORT void AddObserver(DesktopObserver* observer); |
+DISPLAY_EXPORT void RemoveObserver(DesktopObserver* observer); |
+ |
+// Notify all observers that the workspace changed to |new_workspace|. |
+DISPLAY_EXPORT void OnWorkspaceChanged(const std::string& new_workspace); |
+ |
+} // namespace display |
+ |
+} // namespace desktop |
+ |
+#endif // UI_DISPLAY_DESKTOP_OBSERVER_H_ |