| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/common/ash_layout_constants.h" | 9 #include "ash/common/ash_layout_constants.h" |
| 10 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h
" | 10 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h
" |
| 11 #include "ash/common/frame/default_header_painter.h" | 11 #include "ash/common/frame/default_header_painter.h" |
| 12 #include "ash/common/frame/frame_border_hit_test.h" | 12 #include "ash/common/frame/frame_border_hit_test.h" |
| 13 #include "ash/common/frame/header_painter_util.h" | 13 #include "ash/common/frame/header_painter_util.h" |
| 14 #include "ash/common/wm_shell.h" | |
| 15 #include "ash/common/wm_window.h" | 14 #include "ash/common/wm_window.h" |
| 15 #include "ash/shell.h" |
| 16 #include "base/feature_list.h" | 16 #include "base/feature_list.h" |
| 17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 #include "chrome/browser/profiles/profiles_state.h" | 18 #include "chrome/browser/profiles/profiles_state.h" |
| 19 #include "chrome/browser/themes/theme_properties.h" | 19 #include "chrome/browser/themes/theme_properties.h" |
| 20 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 20 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
| 21 #include "chrome/browser/ui/browser.h" | 21 #include "chrome/browser/ui/browser.h" |
| 22 #include "chrome/browser/ui/layout_constants.h" | 22 #include "chrome/browser/ui/layout_constants.h" |
| 23 #include "chrome/browser/ui/views/frame/browser_frame.h" | 23 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 24 #include "chrome/browser/ui/views/frame/browser_header_painter_ash.h" | 24 #include "chrome/browser/ui/views/frame/browser_header_painter_ash.h" |
| 25 #include "chrome/browser/ui/views/frame/browser_view.h" | 25 #include "chrome/browser/ui/views/frame/browser_view.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // BrowserNonClientFrameViewAsh, public: | 70 // BrowserNonClientFrameViewAsh, public: |
| 71 | 71 |
| 72 BrowserNonClientFrameViewAsh::BrowserNonClientFrameViewAsh( | 72 BrowserNonClientFrameViewAsh::BrowserNonClientFrameViewAsh( |
| 73 BrowserFrame* frame, | 73 BrowserFrame* frame, |
| 74 BrowserView* browser_view) | 74 BrowserView* browser_view) |
| 75 : BrowserNonClientFrameView(frame, browser_view), | 75 : BrowserNonClientFrameView(frame, browser_view), |
| 76 caption_button_container_(nullptr), | 76 caption_button_container_(nullptr), |
| 77 window_icon_(nullptr) { | 77 window_icon_(nullptr) { |
| 78 ash::WmWindow::Get(frame->GetNativeWindow()) | 78 ash::WmWindow::Get(frame->GetNativeWindow()) |
| 79 ->InstallResizeHandleWindowTargeter(nullptr); | 79 ->InstallResizeHandleWindowTargeter(nullptr); |
| 80 ash::WmShell::Get()->AddShellObserver(this); | 80 ash::Shell::GetInstance()->AddShellObserver(this); |
| 81 } | 81 } |
| 82 | 82 |
| 83 BrowserNonClientFrameViewAsh::~BrowserNonClientFrameViewAsh() { | 83 BrowserNonClientFrameViewAsh::~BrowserNonClientFrameViewAsh() { |
| 84 ash::WmShell::Get()->RemoveShellObserver(this); | 84 ash::Shell::GetInstance()->RemoveShellObserver(this); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void BrowserNonClientFrameViewAsh::Init() { | 87 void BrowserNonClientFrameViewAsh::Init() { |
| 88 caption_button_container_ = new ash::FrameCaptionButtonContainerView(frame()); | 88 caption_button_container_ = new ash::FrameCaptionButtonContainerView(frame()); |
| 89 caption_button_container_->UpdateSizeButtonVisibility(); | 89 caption_button_container_->UpdateSizeButtonVisibility(); |
| 90 AddChildView(caption_button_container_); | 90 AddChildView(caption_button_container_); |
| 91 | 91 |
| 92 // Initializing the TabIconView is expensive, so only do it if we need to. | 92 // Initializing the TabIconView is expensive, so only do it if we need to. |
| 93 if (browser_view()->ShouldShowWindowIcon()) { | 93 if (browser_view()->ShouldShowWindowIcon()) { |
| 94 window_icon_ = new TabIconView(this, nullptr); | 94 window_icon_ = new TabIconView(this, nullptr); |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 toolbar_bounds.width(), 0); | 452 toolbar_bounds.width(), 0); |
| 453 BrowserView::Paint1pxHorizontalLine(canvas, GetToolbarTopSeparatorColor(), | 453 BrowserView::Paint1pxHorizontalLine(canvas, GetToolbarTopSeparatorColor(), |
| 454 separator_rect, true); | 454 separator_rect, true); |
| 455 | 455 |
| 456 // Toolbar/content separator. | 456 // Toolbar/content separator. |
| 457 toolbar_bounds.Inset(kClientEdgeThickness, 0); | 457 toolbar_bounds.Inset(kClientEdgeThickness, 0); |
| 458 BrowserView::Paint1pxHorizontalLine( | 458 BrowserView::Paint1pxHorizontalLine( |
| 459 canvas, tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR), | 459 canvas, tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR), |
| 460 toolbar_bounds, true); | 460 toolbar_bounds, true); |
| 461 } | 461 } |
| OLD | NEW |