| 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 #include "extensions/browser/app_window/app_window_geometry_cache.h" | 5 #include "extensions/browser/app_window/app_window_geometry_cache.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 189 |
| 190 void AppWindowGeometryCache::OnExtensionLoaded( | 190 void AppWindowGeometryCache::OnExtensionLoaded( |
| 191 content::BrowserContext* browser_context, | 191 content::BrowserContext* browser_context, |
| 192 const Extension* extension) { | 192 const Extension* extension) { |
| 193 LoadGeometryFromStorage(extension->id()); | 193 LoadGeometryFromStorage(extension->id()); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void AppWindowGeometryCache::OnExtensionUnloaded( | 196 void AppWindowGeometryCache::OnExtensionUnloaded( |
| 197 content::BrowserContext* browser_context, | 197 content::BrowserContext* browser_context, |
| 198 const Extension* extension, | 198 const Extension* extension, |
| 199 UnloadedExtensionInfo::Reason reason) { | 199 UnloadedExtensionReason reason) { |
| 200 SyncToStorage(); | 200 SyncToStorage(); |
| 201 cache_.erase(extension->id()); | 201 cache_.erase(extension->id()); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void AppWindowGeometryCache::SetSyncDelayForTests(int timeout_ms) { | 204 void AppWindowGeometryCache::SetSyncDelayForTests(int timeout_ms) { |
| 205 sync_delay_ = base::TimeDelta::FromMilliseconds(timeout_ms); | 205 sync_delay_ = base::TimeDelta::FromMilliseconds(timeout_ms); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void AppWindowGeometryCache::LoadGeometryFromStorage( | 208 void AppWindowGeometryCache::LoadGeometryFromStorage( |
| 209 const std::string& extension_id) { | 209 const std::string& extension_id) { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 | 300 |
| 301 void AppWindowGeometryCache::AddObserver(Observer* observer) { | 301 void AppWindowGeometryCache::AddObserver(Observer* observer) { |
| 302 observers_.AddObserver(observer); | 302 observers_.AddObserver(observer); |
| 303 } | 303 } |
| 304 | 304 |
| 305 void AppWindowGeometryCache::RemoveObserver(Observer* observer) { | 305 void AppWindowGeometryCache::RemoveObserver(Observer* observer) { |
| 306 observers_.RemoveObserver(observer); | 306 observers_.RemoveObserver(observer); |
| 307 } | 307 } |
| 308 | 308 |
| 309 } // namespace extensions | 309 } // namespace extensions |
| OLD | NEW |