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 f5cdf91f6ff0cd226e5e9861d5ed23d9eb5d2cb5..ddfad10b0628dfc651cd560d3fe81b80f9dfbfed 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 |
| @@ -16,15 +16,21 @@ |
| #include "extensions/common/switches.h" |
| #include "third_party/skia/include/core/SkRegion.h" |
| -namespace SetBounds = extensions::api::app_current_window_internal::SetBounds; |
| -namespace SetIcon = extensions::api::app_current_window_internal::SetIcon; |
| -namespace SetInputRegion = |
| - extensions::api::app_current_window_internal::SetInputRegion; |
| +namespace app_current_window_internal = |
| + extensions::api::app_current_window_internal; |
| + |
| +namespace SetBounds = app_current_window_internal::SetBounds; |
| +namespace SetMinWidth = app_current_window_internal::SetMinWidth; |
| +namespace SetMinHeight = app_current_window_internal::SetMinHeight; |
| +namespace SetMaxWidth = app_current_window_internal::SetMaxWidth; |
| +namespace SetMaxHeight = app_current_window_internal::SetMaxHeight; |
| +namespace SetIcon = app_current_window_internal::SetIcon; |
| +namespace SetInputRegion = app_current_window_internal::SetInputRegion; |
| using apps::ShellWindow; |
| -using extensions::api::app_current_window_internal::Bounds; |
| -using extensions::api::app_current_window_internal::Region; |
| -using extensions::api::app_current_window_internal::RegionRect; |
| +using app_current_window_internal::Bounds; |
| +using app_current_window_internal::Region; |
| +using app_current_window_internal::RegionRect; |
| namespace extensions { |
| @@ -130,6 +136,46 @@ bool AppCurrentWindowInternalSetBoundsFunction::RunWithWindow( |
| return true; |
| } |
| +bool AppCurrentWindowInternalSetMinWidthFunction::RunWithWindow( |
| + ShellWindow* window) { |
| + scoped_ptr<SetMinWidth::Params> params(SetMinWidth::Params::Create(*args_)); |
| + CHECK(params.get()); |
| + gfx::Size min_size = window->size_constraints().GetMinimumSize(); |
| + min_size.set_width(params->min_width.get() ? *(params->min_width) : 0); |
|
tapted
2013/10/16 23:31:52
maybe-nit: 0 -> SizeConstraints::kUnboundedSize ?
jackhou1
2013/10/17 03:56:50
Done.
|
| + window->SetMinimumSize(min_size); |
| + return true; |
| +} |
| + |
| +bool AppCurrentWindowInternalSetMinHeightFunction::RunWithWindow( |
| + ShellWindow* window) { |
| + scoped_ptr<SetMinHeight::Params> params(SetMinHeight::Params::Create(*args_)); |
| + CHECK(params.get()); |
| + gfx::Size min_size = window->size_constraints().GetMinimumSize(); |
| + min_size.set_height(params->min_height.get() ? *(params->min_height) : 0); |
| + window->SetMinimumSize(min_size); |
| + return true; |
| +} |
| + |
| +bool AppCurrentWindowInternalSetMaxWidthFunction::RunWithWindow( |
| + ShellWindow* window) { |
| + scoped_ptr<SetMaxWidth::Params> params(SetMaxWidth::Params::Create(*args_)); |
| + CHECK(params.get()); |
| + gfx::Size max_size = window->size_constraints().GetMaximumSize(); |
| + max_size.set_width(params->max_width.get() ? *(params->max_width) : 0); |
| + window->SetMaximumSize(max_size); |
| + return true; |
| +} |
| + |
| +bool AppCurrentWindowInternalSetMaxHeightFunction::RunWithWindow( |
| + ShellWindow* window) { |
| + scoped_ptr<SetMaxHeight::Params> params(SetMaxHeight::Params::Create(*args_)); |
| + CHECK(params.get()); |
| + gfx::Size max_size = window->size_constraints().GetMaximumSize(); |
| + max_size.set_height(params->max_height.get() ? *(params->max_height) : 0); |
| + window->SetMaximumSize(max_size); |
| + return true; |
| +} |
| + |
| bool AppCurrentWindowInternalSetIconFunction::RunWithWindow( |
| ShellWindow* window) { |
| if (GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV && |