OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/shell_window_geometry_cache.h" | 5 #include "apps/shell_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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 eit = tosync.end(); it != eit; ++it) { | 104 eit = tosync.end(); it != eit; ++it) { |
105 const std::string& extension_id = *it; | 105 const std::string& extension_id = *it; |
106 const ExtensionData& extension_data = cache_[extension_id]; | 106 const ExtensionData& extension_data = cache_[extension_id]; |
107 | 107 |
108 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue); | 108 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue); |
109 for (ExtensionData::const_iterator it = extension_data.begin(), | 109 for (ExtensionData::const_iterator it = extension_data.begin(), |
110 eit = extension_data.end(); it != eit; ++it) { | 110 eit = extension_data.end(); it != eit; ++it) { |
111 base::DictionaryValue* value = new base::DictionaryValue; | 111 base::DictionaryValue* value = new base::DictionaryValue; |
112 const gfx::Rect& bounds = it->second.bounds; | 112 const gfx::Rect& bounds = it->second.bounds; |
113 const gfx::Rect& screen_bounds = it->second.screen_bounds; | 113 const gfx::Rect& screen_bounds = it->second.screen_bounds; |
| 114 DCHECK(!bounds.IsEmpty()); |
| 115 DCHECK(!screen_bounds.IsEmpty()); |
| 116 DCHECK(it->second.window_state != ui::SHOW_STATE_DEFAULT); |
114 value->SetInteger("x", bounds.x()); | 117 value->SetInteger("x", bounds.x()); |
115 value->SetInteger("y", bounds.y()); | 118 value->SetInteger("y", bounds.y()); |
116 value->SetInteger("w", bounds.width()); | 119 value->SetInteger("w", bounds.width()); |
117 value->SetInteger("h", bounds.height()); | 120 value->SetInteger("h", bounds.height()); |
118 value->SetInteger("screen_bounds_x", screen_bounds.x()); | 121 value->SetInteger("screen_bounds_x", screen_bounds.x()); |
119 value->SetInteger("screen_bounds_y", screen_bounds.y()); | 122 value->SetInteger("screen_bounds_y", screen_bounds.y()); |
120 value->SetInteger("screen_bounds_w", screen_bounds.width()); | 123 value->SetInteger("screen_bounds_w", screen_bounds.width()); |
121 value->SetInteger("screen_bounds_h", screen_bounds.height()); | 124 value->SetInteger("screen_bounds_h", screen_bounds.height()); |
122 value->SetInteger("state", it->second.window_state); | 125 value->SetInteger("state", it->second.window_state); |
123 value->SetString( | 126 value->SetString( |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 return false; | 310 return false; |
308 } | 311 } |
309 | 312 |
310 content::BrowserContext* | 313 content::BrowserContext* |
311 ShellWindowGeometryCache::Factory::GetBrowserContextToUse( | 314 ShellWindowGeometryCache::Factory::GetBrowserContextToUse( |
312 content::BrowserContext* context) const { | 315 content::BrowserContext* context) const { |
313 return chrome::GetBrowserContextRedirectedInIncognito(context); | 316 return chrome::GetBrowserContextRedirectedInIncognito(context); |
314 } | 317 } |
315 | 318 |
316 } // namespace apps | 319 } // namespace apps |
OLD | NEW |