| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 void AppWindowGeometryCache::SyncToStorage() { | 99 void AppWindowGeometryCache::SyncToStorage() { |
| 100 std::set<std::string> tosync; | 100 std::set<std::string> tosync; |
| 101 tosync.swap(unsynced_extensions_); | 101 tosync.swap(unsynced_extensions_); |
| 102 for (std::set<std::string>::const_iterator it = tosync.begin(), | 102 for (std::set<std::string>::const_iterator it = tosync.begin(), |
| 103 eit = tosync.end(); | 103 eit = tosync.end(); |
| 104 it != eit; | 104 it != eit; |
| 105 ++it) { | 105 ++it) { |
| 106 const std::string& extension_id = *it; | 106 const std::string& extension_id = *it; |
| 107 const ExtensionData& extension_data = cache_[extension_id]; | 107 const ExtensionData& extension_data = cache_[extension_id]; |
| 108 | 108 |
| 109 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue); | 109 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue); |
| 110 for (ExtensionData::const_iterator it = extension_data.begin(), | 110 for (ExtensionData::const_iterator it = extension_data.begin(), |
| 111 eit = extension_data.end(); | 111 eit = extension_data.end(); |
| 112 it != eit; | 112 it != eit; |
| 113 ++it) { | 113 ++it) { |
| 114 base::DictionaryValue* value = new base::DictionaryValue; | 114 base::DictionaryValue* value = new base::DictionaryValue; |
| 115 const gfx::Rect& bounds = it->second.bounds; | 115 const gfx::Rect& bounds = it->second.bounds; |
| 116 const gfx::Rect& screen_bounds = it->second.screen_bounds; | 116 const gfx::Rect& screen_bounds = it->second.screen_bounds; |
| 117 DCHECK(!bounds.IsEmpty()); | 117 DCHECK(!bounds.IsEmpty()); |
| 118 DCHECK(!screen_bounds.IsEmpty()); | 118 DCHECK(!screen_bounds.IsEmpty()); |
| 119 DCHECK(it->second.window_state != ui::SHOW_STATE_DEFAULT); | 119 DCHECK(it->second.window_state != ui::SHOW_STATE_DEFAULT); |
| (...skipping 180 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 |