OLD | NEW |
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> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/frame/caption_buttons/frame_caption_button.h" | 9 #include "ash/frame/caption_buttons/frame_caption_button.h" |
10 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 10 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 107 } |
108 | 108 |
109 BrowserNonClientFrameViewAsh::~BrowserNonClientFrameViewAsh() { | 109 BrowserNonClientFrameViewAsh::~BrowserNonClientFrameViewAsh() { |
110 ash::Shell::GetInstance()->RemoveShellObserver(this); | 110 ash::Shell::GetInstance()->RemoveShellObserver(this); |
111 // browser_view() outlives the frame, as destruction of sibling views happens | 111 // browser_view() outlives the frame, as destruction of sibling views happens |
112 // in the same order as creation - see BrowserView::CreateBrowserWindow. | 112 // in the same order as creation - see BrowserView::CreateBrowserWindow. |
113 chrome::RemoveCommandObserver(browser_view()->browser(), IDC_BACK, this); | 113 chrome::RemoveCommandObserver(browser_view()->browser(), IDC_BACK, this); |
114 } | 114 } |
115 | 115 |
116 void BrowserNonClientFrameViewAsh::Init() { | 116 void BrowserNonClientFrameViewAsh::Init() { |
117 caption_button_container_ = new ash::FrameCaptionButtonContainerView(frame()); | 117 caption_button_container_ = new ash::FrameCaptionButtonContainerView(frame(), |
| 118 ash::FrameCaptionButtonContainerView::MINIMIZE_ALLOWED); |
118 caption_button_container_->UpdateSizeButtonVisibility(); | 119 caption_button_container_->UpdateSizeButtonVisibility(); |
119 AddChildView(caption_button_container_); | 120 AddChildView(caption_button_container_); |
120 | 121 |
121 // Initializing the TabIconView is expensive, so only do it if we need to. | 122 // Initializing the TabIconView is expensive, so only do it if we need to. |
122 if (browser_view()->ShouldShowWindowIcon()) { | 123 if (browser_view()->ShouldShowWindowIcon()) { |
123 window_icon_ = new TabIconView(this, NULL); | 124 window_icon_ = new TabIconView(this, NULL); |
124 window_icon_->set_is_light(true); | 125 window_icon_->set_is_light(true); |
125 AddChildView(window_icon_); | 126 AddChildView(window_icon_); |
126 window_icon_->Update(); | 127 window_icon_->Update(); |
127 } | 128 } |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), | 644 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), |
644 width(), kClientEdgeThickness), | 645 width(), kClientEdgeThickness), |
645 ThemeProperties::GetDefaultColor( | 646 ThemeProperties::GetDefaultColor( |
646 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); | 647 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); |
647 } | 648 } |
648 | 649 |
649 void BrowserNonClientFrameViewAsh::UpdateBackButtonState(bool enabled) { | 650 void BrowserNonClientFrameViewAsh::UpdateBackButtonState(bool enabled) { |
650 web_app_back_button_->SetState(enabled ? views::Button::STATE_NORMAL | 651 web_app_back_button_->SetState(enabled ? views::Button::STATE_NORMAL |
651 : views::Button::STATE_DISABLED); | 652 : views::Button::STATE_DISABLED); |
652 } | 653 } |
OLD | NEW |