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

Unified Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.cc

Issue 9773009: Disable left/right/maximize for panels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 9 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
« no previous file with comments | « chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.cc
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.cc
index 6ddca59b240681092640b61f539ad0e1fc76f157..8faf07a3f61b6bc23616b38627055dfbbd151826 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.cc
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.cc
@@ -15,6 +15,8 @@
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
#include "grit/ui_resources.h"
+#include "ui/aura/window.h"
+#include "ui/aura/client/aura_constants.h"
#include "ui/base/accessibility/accessible_view_state.h"
#include "ui/base/hit_test.h"
#include "ui/base/l10n/l10n_util.h"
@@ -62,7 +64,8 @@ BrowserNonClientFrameViewAura::BrowserNonClientFrameViewAura(
maximize_button_(NULL),
close_button_(NULL),
window_icon_(NULL),
- frame_painter_(new ash::FramePainter) {
+ frame_painter_(new ash::FramePainter),
+ allow_maximize_(true) {
}
BrowserNonClientFrameViewAura::~BrowserNonClientFrameViewAura() {
@@ -70,7 +73,16 @@ BrowserNonClientFrameViewAura::~BrowserNonClientFrameViewAura() {
void BrowserNonClientFrameViewAura::Init() {
// Caption buttons.
- maximize_button_ = new ash::FrameMaximizeButton(this, this);
+ ash::FrameMaximizeButton* maximize_button =
+ new ash::FrameMaximizeButton(this, this);
+ maximize_button_ = maximize_button;
+ // Disable snap left/right and maximize for Panels.
+ if (browser_view()->browser()->is_type_panel() &&
+ browser_view()->browser()->app_type() == Browser::APP_TYPE_CHILD) {
+ allow_maximize_ = false;
+ maximize_button->SetIsLeftRightEnabled(false);
+ maximize_button->set_is_maximize_enabled(false);
+ }
maximize_button_->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_ACCNAME_MAXIMIZE));
AddChildView(maximize_button_);
@@ -239,6 +251,9 @@ void BrowserNonClientFrameViewAura::ButtonPressed(views::Button* sender,
if (sender == maximize_button_) {
// The maximize button may move out from under the cursor.
ResetWindowControls();
+ // Don't maximize if this is a Panel.
+ if (!allow_maximize_)
+ return;
if (frame()->IsMaximized())
frame()->Restore();
else
« no previous file with comments | « chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698