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

Side by Side Diff: chrome/browser/extensions/api/app_window/app_window_api.cc

Issue 11359194: Revert 167255 - ui: Remove gfx::Size::ClampToNonNegative, prevent negative sizes always. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 | « cc/draw_quad_unittest.cc ('k') | chrome/browser/ui/extensions/shell_window.h » ('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 "chrome/browser/extensions/api/app_window/app_window_api.h" 5 #include "chrome/browser/extensions/api/app_window/app_window_api.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/debugger/devtools_window.h" 10 #include "chrome/browser/debugger/devtools_window.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // In the case that minimum size > maximum size, we consider the minimum 176 // In the case that minimum size > maximum size, we consider the minimum
177 // size to be more important. 177 // size to be more important.
178 if (maximum_size.width() && maximum_size.width() < minimum_size.width()) 178 if (maximum_size.width() && maximum_size.width() < minimum_size.width())
179 maximum_size.set_width(minimum_size.width()); 179 maximum_size.set_width(minimum_size.width());
180 if (maximum_size.height() && maximum_size.height() < minimum_size.height()) 180 if (maximum_size.height() && maximum_size.height() < minimum_size.height())
181 maximum_size.set_height(minimum_size.height()); 181 maximum_size.set_height(minimum_size.height());
182 182
183 if (maximum_size.width() && 183 if (maximum_size.width() &&
184 create_params.bounds.width() > maximum_size.width()) 184 create_params.bounds.width() > maximum_size.width())
185 create_params.bounds.set_width(maximum_size.width()); 185 create_params.bounds.set_width(maximum_size.width());
186 if (create_params.bounds.width() != 0 && 186 if (create_params.bounds.width() != INT_MIN &&
187 create_params.bounds.width() < minimum_size.width()) 187 create_params.bounds.width() < minimum_size.width())
188 create_params.bounds.set_width(minimum_size.width()); 188 create_params.bounds.set_width(minimum_size.width());
189 189
190 if (maximum_size.height() && 190 if (maximum_size.height() &&
191 create_params.bounds.height() > maximum_size.height()) 191 create_params.bounds.height() > maximum_size.height())
192 create_params.bounds.set_height(maximum_size.height()); 192 create_params.bounds.set_height(maximum_size.height());
193 if (create_params.bounds.height() != 0 && 193 if (create_params.bounds.height() != INT_MIN &&
194 create_params.bounds.height() < minimum_size.height()) 194 create_params.bounds.height() < minimum_size.height())
195 create_params.bounds.set_height(minimum_size.height()); 195 create_params.bounds.set_height(minimum_size.height());
196 196
197 if (options->hidden.get()) 197 if (options->hidden.get())
198 create_params.hidden = *options->hidden.get(); 198 create_params.hidden = *options->hidden.get();
199 } 199 }
200 200
201 create_params.creator_process_id = 201 create_params.creator_process_id =
202 render_view_host_->GetProcess()->GetID(); 202 render_view_host_->GetProcess()->GetID();
203 203
(...skipping 16 matching lines...) Expand all
220 if (ShellWindowRegistry::Get(profile())->HadDevToolsAttached(created_view)) { 220 if (ShellWindowRegistry::Get(profile())->HadDevToolsAttached(created_view)) {
221 new DevToolsRestorer(this, created_view); 221 new DevToolsRestorer(this, created_view);
222 return true; 222 return true;
223 } 223 }
224 224
225 SendResponse(true); 225 SendResponse(true);
226 return true; 226 return true;
227 } 227 }
228 228
229 } // namespace extensions 229 } // namespace extensions
OLDNEW
« no previous file with comments | « cc/draw_quad_unittest.cc ('k') | chrome/browser/ui/extensions/shell_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698