OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef APPS_APP_WINDOW_GEOMETRY_CACHE_H_ | 5 #ifndef APPS_APP_WINDOW_GEOMETRY_CACHE_H_ |
6 #define APPS_APP_WINDOW_GEOMETRY_CACHE_H_ | 6 #define APPS_APP_WINDOW_GEOMETRY_CACHE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 content::BrowserContext* context) const OVERRIDE; | 58 content::BrowserContext* context) const OVERRIDE; |
59 }; | 59 }; |
60 | 60 |
61 class Observer { | 61 class Observer { |
62 public: | 62 public: |
63 virtual void OnGeometryCacheChanged(const std::string& extension_id, | 63 virtual void OnGeometryCacheChanged(const std::string& extension_id, |
64 const std::string& window_id, | 64 const std::string& window_id, |
65 const gfx::Rect& bounds) = 0; | 65 const gfx::Rect& bounds) = 0; |
66 | 66 |
67 protected: | 67 protected: |
68 virtual ~Observer() {}; | 68 virtual ~Observer() {} |
69 }; | 69 }; |
70 | 70 |
71 AppWindowGeometryCache(Profile* profile, extensions::ExtensionPrefs* prefs); | 71 AppWindowGeometryCache(Profile* profile, extensions::ExtensionPrefs* prefs); |
72 | 72 |
73 virtual ~AppWindowGeometryCache(); | 73 virtual ~AppWindowGeometryCache(); |
74 | 74 |
75 // Returns the instance for the given browsing context. | 75 // Returns the instance for the given browsing context. |
76 static AppWindowGeometryCache* Get(content::BrowserContext* context); | 76 static AppWindowGeometryCache* Get(content::BrowserContext* context); |
77 | 77 |
78 // Save the geometry and state associated with |extension_id| and |window_id|. | 78 // Save the geometry and state associated with |extension_id| and |window_id|. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // The timeout value we'll use for |sync_timer_|. | 146 // The timeout value we'll use for |sync_timer_|. |
147 base::TimeDelta sync_delay_; | 147 base::TimeDelta sync_delay_; |
148 | 148 |
149 content::NotificationRegistrar registrar_; | 149 content::NotificationRegistrar registrar_; |
150 ObserverList<Observer> observers_; | 150 ObserverList<Observer> observers_; |
151 }; | 151 }; |
152 | 152 |
153 } // namespace apps | 153 } // namespace apps |
154 | 154 |
155 #endif // APPS_APP_WINDOW_GEOMETRY_CACHE_H_ | 155 #endif // APPS_APP_WINDOW_GEOMETRY_CACHE_H_ |
OLD | NEW |