| 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 cfabf6a85aad82c99eecacb816f270699c71af9f..659c8ac4b6f0aee2c581acf34c65e07e2952c574 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
|
| @@ -3,9 +3,13 @@
|
| // found in the LICENSE file.
|
|
|
| #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 "extensions/common/error_utils.h"
|
| +#include "chrome/common/extensions/api/app_current_window_internal.h"
|
| +
|
| +namespace SetBounds = extensions::api::app_current_window_internal::SetBounds;
|
| +using extensions::api::app_current_window_internal::Bounds;
|
|
|
| namespace extensions {
|
|
|
| @@ -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);
|
| + return true;
|
| +}
|
| +
|
| } // namespace extensions
|
|
|