Chromium Code Reviews| Index: chrome/browser/extensions/api/app_window/app_window_api.cc |
| diff --git a/chrome/browser/extensions/api/app_window/app_window_api.cc b/chrome/browser/extensions/api/app_window/app_window_api.cc |
| index 4bebe7e0415ef1db19c2c5d376af015ffb6d230c..e946fbd67ab14c09c51f1d72df42103861ca1871 100644 |
| --- a/chrome/browser/extensions/api/app_window/app_window_api.cc |
| +++ b/chrome/browser/extensions/api/app_window/app_window_api.cc |
| @@ -58,14 +58,35 @@ bool AppWindowCreateFunction::RunImpl() { |
| ShellWindow::CreateParams create_params; |
| app_window::CreateWindowOptions* options = params->options.get(); |
| if (options) { |
| - if (options->width.get()) |
| - create_params.bounds.set_width(*options->width.get()); |
| - if (options->height.get()) |
| - create_params.bounds.set_height(*options->height.get()); |
| - if (options->left.get()) |
| - create_params.bounds.set_x(*options->left.get()); |
| - if (options->top.get()) |
| - create_params.bounds.set_y(*options->top.get()); |
| + if (options->id.get()) |
| + // TODO(mek): use URL if no id specified? |
| + create_params.window_key = *options->id; |
|
asargent_no_longer_on_chrome
2012/08/28 18:49:41
nit: can you enforce that the id is some reasonabl
Marijn Kruisselbrink
2012/08/28 22:14:58
Done.
|
| + |
| + if (options->default_width.get()) |
| + create_params.bounds.set_width(*options->default_width.get()); |
| + if (options->default_height.get()) |
| + create_params.bounds.set_height(*options->default_height.get()); |
| + if (options->default_left.get()) |
| + create_params.bounds.set_x(*options->default_left.get()); |
| + if (options->default_top.get()) |
| + create_params.bounds.set_y(*options->default_top.get()); |
| + |
| + |
| + if (options->width.get() || options->height.get()) { |
| + if (options->width.get()) |
| + create_params.bounds.set_width(*options->width.get()); |
| + if (options->height.get()) |
| + create_params.bounds.set_height(*options->height.get()); |
| + create_params.restoreSize = false; |
| + } |
| + |
| + if (options->left.get() || options->top.get()) { |
| + if (options->left.get()) |
| + create_params.bounds.set_x(*options->left.get()); |
| + if (options->top.get()) |
| + create_params.bounds.set_y(*options->top.get()); |
| + create_params.restorePosition = false; |
| + } |
| if (options->frame.get()) { |
| create_params.frame = *options->frame == kNoneFrameOption ? |