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 "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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // In the case that minimum size > maximum size, we consider the minimum | 164 // In the case that minimum size > maximum size, we consider the minimum |
165 // size to be more important. | 165 // size to be more important. |
166 if (maximum_size.width() && maximum_size.width() < minimum_size.width()) | 166 if (maximum_size.width() && maximum_size.width() < minimum_size.width()) |
167 maximum_size.set_width(minimum_size.width()); | 167 maximum_size.set_width(minimum_size.width()); |
168 if (maximum_size.height() && maximum_size.height() < minimum_size.height()) | 168 if (maximum_size.height() && maximum_size.height() < minimum_size.height()) |
169 maximum_size.set_height(minimum_size.height()); | 169 maximum_size.set_height(minimum_size.height()); |
170 | 170 |
171 if (maximum_size.width() && | 171 if (maximum_size.width() && |
172 create_params.bounds.width() > maximum_size.width()) | 172 create_params.bounds.width() > maximum_size.width()) |
173 create_params.bounds.set_width(maximum_size.width()); | 173 create_params.bounds.set_width(maximum_size.width()); |
174 if (create_params.bounds.width() != INT_MIN && | 174 if (create_params.bounds.width() != 0 && |
175 create_params.bounds.width() < minimum_size.width()) | 175 create_params.bounds.width() < minimum_size.width()) |
176 create_params.bounds.set_width(minimum_size.width()); | 176 create_params.bounds.set_width(minimum_size.width()); |
177 | 177 |
178 if (maximum_size.height() && | 178 if (maximum_size.height() && |
179 create_params.bounds.height() > maximum_size.height()) | 179 create_params.bounds.height() > maximum_size.height()) |
180 create_params.bounds.set_height(maximum_size.height()); | 180 create_params.bounds.set_height(maximum_size.height()); |
181 if (create_params.bounds.height() != INT_MIN && | 181 if (create_params.bounds.height() != 0 && |
182 create_params.bounds.height() < minimum_size.height()) | 182 create_params.bounds.height() < minimum_size.height()) |
183 create_params.bounds.set_height(minimum_size.height()); | 183 create_params.bounds.set_height(minimum_size.height()); |
184 | 184 |
185 if (options->hidden.get()) | 185 if (options->hidden.get()) |
186 create_params.hidden = *options->hidden.get(); | 186 create_params.hidden = *options->hidden.get(); |
187 } | 187 } |
188 | 188 |
189 create_params.creator_process_id = | 189 create_params.creator_process_id = |
190 render_view_host_->GetProcess()->GetID(); | 190 render_view_host_->GetProcess()->GetID(); |
191 | 191 |
(...skipping 16 matching lines...) Expand all Loading... |
208 if (ShellWindowRegistry::Get(profile())->HadDevToolsAttached(created_view)) { | 208 if (ShellWindowRegistry::Get(profile())->HadDevToolsAttached(created_view)) { |
209 new DevToolsRestorer(this, created_view); | 209 new DevToolsRestorer(this, created_view); |
210 return true; | 210 return true; |
211 } | 211 } |
212 | 212 |
213 SendResponse(true); | 213 SendResponse(true); |
214 return true; | 214 return true; |
215 } | 215 } |
216 | 216 |
217 } // namespace extensions | 217 } // namespace extensions |
OLD | NEW |