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..ba368d21aea0951f6755028d2cd9d75064751701 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,40 @@ 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? |
| + // Limit length of id to 256 characters. |
| + if (options->id->length() > 256) |
| + create_params.window_key = options->id->substr(0, 256); |
|
asargent_no_longer_on_chrome
2012/08/29 19:54:18
Instead of silently truncating, let's instead retu
|
| + else |
| + create_params.window_key = *options->id; |
| + } |
| + |
| + 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 ? |