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

Side by Side Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc

Issue 308683002: Move MaximizeModeWindowManager to the controller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h" 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h"
6 6
7 #include <algorithm>
8
7 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" 10 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
9 #include "ash/frame/default_header_painter.h" 11 #include "ash/frame/default_header_painter.h"
10 #include "ash/frame/frame_border_hit_test_controller.h" 12 #include "ash/frame/frame_border_hit_test_controller.h"
11 #include "ash/frame/header_painter_util.h" 13 #include "ash/frame/header_painter_util.h"
12 #include "ash/shell.h" 14 #include "ash/shell.h"
13 #include "base/command_line.h" 15 #include "base/command_line.h"
14 #include "chrome/browser/themes/theme_properties.h" 16 #include "chrome/browser/themes/theme_properties.h"
15 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
16 #include "chrome/browser/ui/views/frame/browser_frame.h" 18 #include "chrome/browser/ui/views/frame/browser_frame.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 ash::Shell::GetInstance()->AddShellObserver(this); 89 ash::Shell::GetInstance()->AddShellObserver(this);
88 } 90 }
89 91
90 BrowserNonClientFrameViewAsh::~BrowserNonClientFrameViewAsh() { 92 BrowserNonClientFrameViewAsh::~BrowserNonClientFrameViewAsh() {
91 ash::Shell::GetInstance()->RemoveShellObserver(this); 93 ash::Shell::GetInstance()->RemoveShellObserver(this);
92 } 94 }
93 95
94 void BrowserNonClientFrameViewAsh::Init() { 96 void BrowserNonClientFrameViewAsh::Init() {
95 caption_button_container_ = new ash::FrameCaptionButtonContainerView(frame(), 97 caption_button_container_ = new ash::FrameCaptionButtonContainerView(frame(),
96 ash::FrameCaptionButtonContainerView::MINIMIZE_ALLOWED); 98 ash::FrameCaptionButtonContainerView::MINIMIZE_ALLOWED);
97 caption_button_container_->UpdateSizeButtonVisibility( 99 caption_button_container_->UpdateSizeButtonVisibility();
98 ash::Shell::GetInstance()->IsMaximizeModeWindowManagerEnabled());
99 AddChildView(caption_button_container_); 100 AddChildView(caption_button_container_);
100 101
101 // Initializing the TabIconView is expensive, so only do it if we need to. 102 // Initializing the TabIconView is expensive, so only do it if we need to.
102 if (browser_view()->ShouldShowWindowIcon()) { 103 if (browser_view()->ShouldShowWindowIcon()) {
103 window_icon_ = new TabIconView(this, NULL); 104 window_icon_ = new TabIconView(this, NULL);
104 window_icon_->set_is_light(true); 105 window_icon_->set_is_light(true);
105 AddChildView(window_icon_); 106 AddChildView(window_icon_);
106 window_icon_->Update(); 107 window_icon_->Update();
107 } 108 }
108 109
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 min_width = std::max(min_width, 339 min_width = std::max(min_width,
339 min_tabstrip_width + GetTabStripLeftInset() + GetTabStripRightInset()); 340 min_tabstrip_width + GetTabStripLeftInset() + GetTabStripRightInset());
340 } 341 }
341 return gfx::Size(min_width, min_client_view_size.height()); 342 return gfx::Size(min_width, min_client_view_size.height());
342 } 343 }
343 344
344 /////////////////////////////////////////////////////////////////////////////// 345 ///////////////////////////////////////////////////////////////////////////////
345 // ash::ShellObserver: 346 // ash::ShellObserver:
346 347
347 void BrowserNonClientFrameViewAsh::OnMaximizeModeStarted() { 348 void BrowserNonClientFrameViewAsh::OnMaximizeModeStarted() {
348 caption_button_container_->UpdateSizeButtonVisibility(true); 349 caption_button_container_->UpdateSizeButtonVisibility();
349 InvalidateLayout(); 350 InvalidateLayout();
350 frame()->client_view()->InvalidateLayout(); 351 frame()->client_view()->InvalidateLayout();
351 frame()->GetRootView()->Layout(); 352 frame()->GetRootView()->Layout();
352 } 353 }
353 354
354 void BrowserNonClientFrameViewAsh::OnMaximizeModeEnded() { 355 void BrowserNonClientFrameViewAsh::OnMaximizeModeEnded() {
355 caption_button_container_->UpdateSizeButtonVisibility(false); 356 caption_button_container_->UpdateSizeButtonVisibility();
356 InvalidateLayout(); 357 InvalidateLayout();
357 frame()->client_view()->InvalidateLayout(); 358 frame()->client_view()->InvalidateLayout();
358 frame()->GetRootView()->Layout(); 359 frame()->GetRootView()->Layout();
359 } 360 }
360 361
361 /////////////////////////////////////////////////////////////////////////////// 362 ///////////////////////////////////////////////////////////////////////////////
362 // chrome::TabIconViewModel: 363 // chrome::TabIconViewModel:
363 364
364 bool BrowserNonClientFrameViewAsh::ShouldTabIconViewAnimate() const { 365 bool BrowserNonClientFrameViewAsh::ShouldTabIconViewAnimate() const {
365 // This function is queried during the creation of the window as the 366 // This function is queried during the creation of the window as the
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); 534 ThemeProperties::COLOR_TOOLBAR_SEPARATOR));
534 } 535 }
535 536
536 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { 537 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) {
537 DCHECK(!UsePackagedAppHeaderStyle()); 538 DCHECK(!UsePackagedAppHeaderStyle());
538 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), 539 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(),
539 width(), kClientEdgeThickness), 540 width(), kClientEdgeThickness),
540 ThemeProperties::GetDefaultColor( 541 ThemeProperties::GetDefaultColor(
541 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); 542 ThemeProperties::COLOR_TOOLBAR_SEPARATOR));
542 } 543 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698