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

Side by Side Diff: apps/app_window_geometry_cache.cc

Issue 247143004: cleanup: Cpplint for apps/, extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CHECK_GT -> CHECK Created 6 years, 8 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
« no previous file with comments | « apps/app_window_geometry_cache.h ('k') | apps/app_window_geometry_cache_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "apps/app_window_geometry_cache.h" 5 #include "apps/app_window_geometry_cache.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 143
144 prefs_->SetGeometryCache(extension_id, dict.Pass()); 144 prefs_->SetGeometryCache(extension_id, dict.Pass());
145 } 145 }
146 } 146 }
147 147
148 bool AppWindowGeometryCache::GetGeometry(const std::string& extension_id, 148 bool AppWindowGeometryCache::GetGeometry(const std::string& extension_id,
149 const std::string& window_id, 149 const std::string& window_id,
150 gfx::Rect* bounds, 150 gfx::Rect* bounds,
151 gfx::Rect* screen_bounds, 151 gfx::Rect* screen_bounds,
152 ui::WindowShowState* window_state) { 152 ui::WindowShowState* window_state) {
153
154 std::map<std::string, ExtensionData>::const_iterator extension_data_it = 153 std::map<std::string, ExtensionData>::const_iterator extension_data_it =
155 cache_.find(extension_id); 154 cache_.find(extension_id);
156 155
157 // Not in the map means loading data for the extension didn't finish yet or 156 // Not in the map means loading data for the extension didn't finish yet or
158 // the cache was not constructed until after the extension was loaded. 157 // the cache was not constructed until after the extension was loaded.
159 // Attempt to load from sync to address the latter case. 158 // Attempt to load from sync to address the latter case.
160 if (extension_data_it == cache_.end()) { 159 if (extension_data_it == cache_.end()) {
161 LoadGeometryFromStorage(extension_id); 160 LoadGeometryFromStorage(extension_id);
162 extension_data_it = cache_.find(extension_id); 161 extension_data_it = cache_.find(extension_id);
163 DCHECK(extension_data_it != cache_.end()); 162 DCHECK(extension_data_it != cache_.end());
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 325
327 void AppWindowGeometryCache::AddObserver(Observer* observer) { 326 void AppWindowGeometryCache::AddObserver(Observer* observer) {
328 observers_.AddObserver(observer); 327 observers_.AddObserver(observer);
329 } 328 }
330 329
331 void AppWindowGeometryCache::RemoveObserver(Observer* observer) { 330 void AppWindowGeometryCache::RemoveObserver(Observer* observer) {
332 observers_.RemoveObserver(observer); 331 observers_.RemoveObserver(observer);
333 } 332 }
334 333
335 } // namespace apps 334 } // namespace apps
OLDNEW
« no previous file with comments | « apps/app_window_geometry_cache.h ('k') | apps/app_window_geometry_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698