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

Side by Side Diff: apps/shell_window_geometry_cache.cc

Issue 22611004: DCHECK that invalid app window states are not cached. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | apps/shell_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 (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
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
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
OLDNEW
« no previous file with comments | « no previous file | apps/shell_window_geometry_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698