Chromium Code Reviews| Index: chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc |
| diff --git a/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc b/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc |
| index 5619b65ae38f145f31215d73e5a5ced08ba9ea43..e14bf9a7cda429077044bc1489fc94c42db4b9db 100644 |
| --- a/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc |
| +++ b/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc |
| @@ -5,8 +5,12 @@ |
| #include "chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.h" |
| #include "chrome/browser/extensions/shell_window_registry.h" |
| #include "chrome/browser/ui/extensions/shell_window.h" |
| +#include "chrome/common/extensions/api/app_current_window_internal.h" |
| #include "chrome/common/extensions/extension_error_utils.h" |
| +namespace SetBounds = extensions::api::app_current_window_internal::SetBounds; |
| +using extensions::api::app_current_window_internal::Bounds; |
| + |
| namespace extensions { |
| namespace { |
| @@ -80,4 +84,24 @@ bool AppCurrentWindowInternalHideFunction::RunWithWindow( |
| return true; |
| } |
| +bool AppCurrentWindowInternalSetBoundsFunction::RunWithWindow( |
| + ShellWindow* window) { |
| + // Start with the current bounds, and change any values that are specified in |
| + // the incoming parameters. |
| + gfx::Rect bounds = window->GetBaseWindow()->GetBounds(); |
| + scoped_ptr<SetBounds::Params> params(SetBounds::Params::Create(*args_)); |
| + CHECK(params.get()); |
| + if (params->bounds.left) |
| + bounds.set_x(*(params->bounds.left)); |
| + if (params->bounds.top) |
| + bounds.set_y(*(params->bounds.top)); |
| + if (params->bounds.width) |
| + bounds.set_width(*(params->bounds.width)); |
| + if (params->bounds.height) |
| + bounds.set_height(*(params->bounds.height)); |
| + |
| + window->GetBaseWindow()->SetBounds(bounds); |
|
jeremya
2012/11/13 06:16:30
I think this ought to set the *content* bounds, no
asargent_no_longer_on_chrome
2012/11/14 05:22:12
Ok.
BTW, if we're maintaining cached values of bo
|
| + return true; |
| +} |
| + |
| } // namespace extensions |