Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3758)

Unified Diff: chrome/browser/extensions/api/app_window/app_window_api.cc

Issue 13934007: Adding experimental maximize mode (behind a flag) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Step back and a few changes Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 1f726db950869721bfeacc309dadf83f108de687..5a572c500d65ca3e3f4243a2a71bafefab805b43 100644
--- a/chrome/browser/extensions/api/app_window/app_window_api.cc
+++ b/chrome/browser/extensions/api/app_window/app_window_api.cc
@@ -24,6 +24,13 @@
#include "googleurl/src/gurl.h"
#include "ui/gfx/rect.h"
+#if defined(USE_ASH)
+#include "ash/shell.h"
+#include "ash/wm/property_util.h"
+#include "ui/aura/root_window.h"
+#include "ui/aura/window.h"
+#endif
+
namespace app_window = extensions::api::app_window;
namespace Create = app_window::Create;
@@ -101,6 +108,11 @@ bool AppWindowCreateFunction::RunImpl() {
// with a hack in AppWindowCustomBindings::GetView().
ShellWindow::CreateParams create_params;
app_window::CreateWindowOptions* options = params->options.get();
+#if defined(USE_ASH)
+ bool force_maximize = ash::Shell::IsForcedMaximizeMode();
+#else
+ bool force_maximize = false;
+#endif
if (options) {
if (options->id.get()) {
// TODO(mek): use URL if no id specified?
@@ -227,6 +239,8 @@ bool AppWindowCreateFunction::RunImpl() {
create_params.state = ShellWindow::CreateParams::STATE_MINIMIZED;
break;
}
+ } else {
+ force_maximize = false;
}
}
@@ -236,6 +250,21 @@ bool AppWindowCreateFunction::RunImpl() {
ShellWindow* shell_window =
ShellWindow::Create(profile(), GetExtension(), url, create_params);
+#if USE_ASH
+ if (force_maximize && !create_params.maximum_size.IsEmpty()) {
+ // Test if the application can be resized to the full extent of the given
+ // screen.
+ gfx::Size size =
+ shell_window->GetNativeWindow()->GetRootWindow()->bounds().size();
+ if (size.width() > create_params.maximum_size.width() ||
+ size.height() > create_params.maximum_size.height())
+ force_maximize = false;
+ }
+ #endif
+ if (force_maximize)
sky 2013/05/01 04:32:04 And I don't think you wanted this either.
Mr4D (OOO till 08-26) 2013/05/01 17:57:23 Done.
+ ash::SetPersistsAcrossAllWorkspaces(shell_window->GetNativeWindow(),
+ ash::WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_NO);
+
if (chrome::ShouldForceFullscreenApp())
shell_window->Fullscreen();

Powered by Google App Engine
This is Rietveld 408576698