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

Unified Diff: apps/shell_window_geometry_cache.cc

Issue 21444002: Do not restore corrupt cached app window bounds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « apps/shell_window_geometry_cache.h ('k') | apps/shell_window_geometry_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/shell_window_geometry_cache.cc
diff --git a/apps/shell_window_geometry_cache.cc b/apps/shell_window_geometry_cache.cc
index caa83acba04ed343dda8cb622f2cbc82f1ad8817..f1d0c1274a1fbee1fea3bfeb73e698a8b6f6bf2e 100644
--- a/apps/shell_window_geometry_cache.cc
+++ b/apps/shell_window_geometry_cache.cc
@@ -153,6 +153,13 @@ bool ShellWindowGeometryCache::GetGeometry(
if (window_data == extension_data_it->second.end())
return false;
+ // Check for and do not return corrupt data.
+ if ((bounds && window_data->second.bounds.IsEmpty()) ||
+ (screen_bounds && window_data->second.screen_bounds.IsEmpty()) ||
+ (window_state &&
+ window_data->second.window_state == ui::SHOW_STATE_DEFAULT))
+ return false;
+
Ken Rockot(use gerrit already) 2013/08/01 01:04:49 nit: It might be nicer to use a named WindowData&
if (bounds)
*bounds = window_data->second.bounds;
if (screen_bounds)
« no previous file with comments | « apps/shell_window_geometry_cache.h ('k') | apps/shell_window_geometry_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698