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); | |
119 caption_button_container_->UpdateSizeButtonVisibility(); | 118 caption_button_container_->UpdateSizeButtonVisibility(); |
120 AddChildView(caption_button_container_); | 119 AddChildView(caption_button_container_); |
121 | 120 |
122 // Initializing the TabIconView is expensive, so only do it if we need to. | 121 // Initializing the TabIconView is expensive, so only do it if we need to. |
123 if (browser_view()->ShouldShowWindowIcon()) { | 122 if (browser_view()->ShouldShowWindowIcon()) { |
124 window_icon_ = new TabIconView(this, NULL); | 123 window_icon_ = new TabIconView(this, NULL); |
125 window_icon_->set_is_light(true); | 124 window_icon_->set_is_light(true); |
126 AddChildView(window_icon_); | 125 AddChildView(window_icon_); |
127 window_icon_->Update(); | 126 window_icon_->Update(); |
128 } | 127 } |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), | 643 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), |
645 width(), kClientEdgeThickness), | 644 width(), kClientEdgeThickness), |
646 ThemeProperties::GetDefaultColor( | 645 ThemeProperties::GetDefaultColor( |
647 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); | 646 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); |
648 } | 647 } |
649 | 648 |
650 void BrowserNonClientFrameViewAsh::UpdateBackButtonState(bool enabled) { | 649 void BrowserNonClientFrameViewAsh::UpdateBackButtonState(bool enabled) { |
651 web_app_back_button_->SetState(enabled ? views::Button::STATE_NORMAL | 650 web_app_back_button_->SetState(enabled ? views::Button::STATE_NORMAL |
652 : views::Button::STATE_DISABLED); | 651 : views::Button::STATE_DISABLED); |
653 } | 652 } |
OLD | NEW |