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

Side by Side Diff: extensions/browser/app_window/app_window_geometry_cache.h

Issue 622343002: replace OVERRIDE and FINAL with override and final in extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
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 EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_GEOMETRY_CACHE_H_ 5 #ifndef EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_GEOMETRY_CACHE_H_
6 #define EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_GEOMETRY_CACHE_H_ 6 #define EXTENSIONS_BROWSER_APP_WINDOW_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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 static Factory* GetInstance(); 42 static Factory* GetInstance();
43 43
44 private: 44 private:
45 friend struct DefaultSingletonTraits<Factory>; 45 friend struct DefaultSingletonTraits<Factory>;
46 46
47 Factory(); 47 Factory();
48 virtual ~Factory(); 48 virtual ~Factory();
49 49
50 // BrowserContextKeyedServiceFactory 50 // BrowserContextKeyedServiceFactory
51 virtual KeyedService* BuildServiceInstanceFor( 51 virtual KeyedService* BuildServiceInstanceFor(
52 content::BrowserContext* context) const OVERRIDE; 52 content::BrowserContext* context) const override;
53 virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; 53 virtual bool ServiceIsNULLWhileTesting() const override;
54 virtual content::BrowserContext* GetBrowserContextToUse( 54 virtual content::BrowserContext* GetBrowserContextToUse(
55 content::BrowserContext* context) const OVERRIDE; 55 content::BrowserContext* context) const override;
56 }; 56 };
57 57
58 class Observer { 58 class Observer {
59 public: 59 public:
60 virtual void OnGeometryCacheChanged(const std::string& extension_id, 60 virtual void OnGeometryCacheChanged(const std::string& extension_id,
61 const std::string& window_id, 61 const std::string& window_id,
62 const gfx::Rect& bounds) = 0; 62 const gfx::Rect& bounds) = 0;
63 63
64 protected: 64 protected:
65 virtual ~Observer() {} 65 virtual ~Observer() {}
(...skipping 17 matching lines...) Expand all
83 // Get any saved geometry and state associated with |extension_id| and 83 // Get any saved geometry and state associated with |extension_id| and
84 // |window_id|. If saved data exists, sets |bounds|, |screen_bounds| and 84 // |window_id|. If saved data exists, sets |bounds|, |screen_bounds| and
85 // |state| if not NULL and returns true. 85 // |state| if not NULL and returns true.
86 bool GetGeometry(const std::string& extension_id, 86 bool GetGeometry(const std::string& extension_id,
87 const std::string& window_id, 87 const std::string& window_id,
88 gfx::Rect* bounds, 88 gfx::Rect* bounds,
89 gfx::Rect* screen_bounds, 89 gfx::Rect* screen_bounds,
90 ui::WindowShowState* state); 90 ui::WindowShowState* state);
91 91
92 // KeyedService 92 // KeyedService
93 virtual void Shutdown() OVERRIDE; 93 virtual void Shutdown() override;
94 94
95 void AddObserver(Observer* observer); 95 void AddObserver(Observer* observer);
96 void RemoveObserver(Observer* observer); 96 void RemoveObserver(Observer* observer);
97 97
98 // Maximum number of windows we'll cache the geometry for per app. 98 // Maximum number of windows we'll cache the geometry for per app.
99 static const size_t kMaxCachedWindows = 100; 99 static const size_t kMaxCachedWindows = 100;
100 100
101 protected: 101 protected:
102 friend class AppWindowGeometryCacheTest; 102 friend class AppWindowGeometryCacheTest;
103 103
(...skipping 11 matching lines...) Expand all
115 gfx::Rect screen_bounds; 115 gfx::Rect screen_bounds;
116 ui::WindowShowState window_state; 116 ui::WindowShowState window_state;
117 base::Time last_change; 117 base::Time last_change;
118 }; 118 };
119 119
120 // Data stored for each extension. 120 // Data stored for each extension.
121 typedef std::map<std::string, WindowData> ExtensionData; 121 typedef std::map<std::string, WindowData> ExtensionData;
122 122
123 // ExtensionRegistryObserver implementation. 123 // ExtensionRegistryObserver implementation.
124 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, 124 virtual void OnExtensionLoaded(content::BrowserContext* browser_context,
125 const Extension* extension) OVERRIDE; 125 const Extension* extension) override;
126 virtual void OnExtensionUnloaded( 126 virtual void OnExtensionUnloaded(
127 content::BrowserContext* browser_context, 127 content::BrowserContext* browser_context,
128 const Extension* extension, 128 const Extension* extension,
129 UnloadedExtensionInfo::Reason reason) OVERRIDE; 129 UnloadedExtensionInfo::Reason reason) override;
130 130
131 void LoadGeometryFromStorage(const std::string& extension_id); 131 void LoadGeometryFromStorage(const std::string& extension_id);
132 void SyncToStorage(); 132 void SyncToStorage();
133 133
134 // Preferences storage. 134 // Preferences storage.
135 ExtensionPrefs* prefs_; 135 ExtensionPrefs* prefs_;
136 136
137 // Cached data. 137 // Cached data.
138 std::map<std::string, ExtensionData> cache_; 138 std::map<std::string, ExtensionData> cache_;
139 139
140 // Data that still needs saving. 140 // Data that still needs saving.
141 std::set<std::string> unsynced_extensions_; 141 std::set<std::string> unsynced_extensions_;
142 142
143 // The timer used to save the data. 143 // The timer used to save the data.
144 base::OneShotTimer<AppWindowGeometryCache> sync_timer_; 144 base::OneShotTimer<AppWindowGeometryCache> sync_timer_;
145 145
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 // Listen to extension load, unloaded notifications. 149 // Listen to extension load, unloaded notifications.
150 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> 150 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
151 extension_registry_observer_; 151 extension_registry_observer_;
152 152
153 ObserverList<Observer> observers_; 153 ObserverList<Observer> observers_;
154 }; 154 };
155 155
156 } // namespace extensions 156 } // namespace extensions
157 157
158 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_GEOMETRY_CACHE_H_ 158 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_GEOMETRY_CACHE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698