| 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/ash_layout_constants.h" | 9 #include "ash/ash_layout_constants.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" |
| 11 #include "ash/frame/default_header_painter.h" | 11 #include "ash/frame/default_header_painter.h" |
| 12 #include "ash/frame/frame_border_hit_test.h" | 12 #include "ash/frame/frame_border_hit_test.h" |
| 13 #include "ash/frame/header_painter_util.h" | 13 #include "ash/frame/header_painter_util.h" |
| 14 #include "ash/shell.h" | 14 #include "ash/shell.h" |
| 15 #include "ash/wm/window_util.h" | 15 #include "ash/wm/window_util.h" |
| 16 #include "base/feature_list.h" | |
| 17 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 18 #include "chrome/browser/profiles/profiles_state.h" | 17 #include "chrome/browser/profiles/profiles_state.h" |
| 19 #include "chrome/browser/themes/theme_properties.h" | 18 #include "chrome/browser/themes/theme_properties.h" |
| 20 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 19 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
| 21 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
| 22 #include "chrome/browser/ui/layout_constants.h" | 21 #include "chrome/browser/ui/layout_constants.h" |
| 23 #include "chrome/browser/ui/views/frame/browser_frame.h" | 22 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 24 #include "chrome/browser/ui/views/frame/browser_header_painter_ash.h" | 23 #include "chrome/browser/ui/views/frame/browser_header_painter_ash.h" |
| 25 #include "chrome/browser/ui/views/frame/browser_view.h" | 24 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 26 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" | 25 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" |
| 27 #include "chrome/browser/ui/views/profiles/profile_indicator_icon.h" | 26 #include "chrome/browser/ui/views/profiles/profile_indicator_icon.h" |
| 28 #include "chrome/browser/ui/views/tab_icon_view.h" | 27 #include "chrome/browser/ui/views/tab_icon_view.h" |
| 29 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 28 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 30 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" | 29 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
| 31 #include "chrome/browser/web_applications/web_app.h" | 30 #include "chrome/browser/web_applications/web_app.h" |
| 32 #include "chrome/common/chrome_features.h" | |
| 33 #include "chrome/grit/theme_resources.h" | 31 #include "chrome/grit/theme_resources.h" |
| 34 #include "content/public/browser/web_contents.h" | 32 #include "content/public/browser/web_contents.h" |
| 35 #include "third_party/skia/include/core/SkColor.h" | 33 #include "third_party/skia/include/core/SkColor.h" |
| 36 #include "ui/accessibility/ax_node_data.h" | 34 #include "ui/accessibility/ax_node_data.h" |
| 37 #include "ui/aura/client/aura_constants.h" | 35 #include "ui/aura/client/aura_constants.h" |
| 38 #include "ui/aura/window.h" | 36 #include "ui/aura/window.h" |
| 39 #include "ui/base/hit_test.h" | 37 #include "ui/base/hit_test.h" |
| 40 #include "ui/base/layout.h" | 38 #include "ui/base/layout.h" |
| 41 #include "ui/base/theme_provider.h" | 39 #include "ui/base/theme_provider.h" |
| 42 #include "ui/compositor/layer_animator.h" | 40 #include "ui/compositor/layer_animator.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 AddChildView(window_icon_); | 93 AddChildView(window_icon_); |
| 96 window_icon_->Update(); | 94 window_icon_->Update(); |
| 97 } | 95 } |
| 98 | 96 |
| 99 if (UsePackagedAppHeaderStyle()) { | 97 if (UsePackagedAppHeaderStyle()) { |
| 100 ash::DefaultHeaderPainter* header_painter = new ash::DefaultHeaderPainter; | 98 ash::DefaultHeaderPainter* header_painter = new ash::DefaultHeaderPainter; |
| 101 header_painter_.reset(header_painter); | 99 header_painter_.reset(header_painter); |
| 102 header_painter->Init(frame(), this, caption_button_container_); | 100 header_painter->Init(frame(), this, caption_button_container_); |
| 103 if (window_icon_) | 101 if (window_icon_) |
| 104 header_painter->UpdateLeftHeaderView(window_icon_); | 102 header_painter->UpdateLeftHeaderView(window_icon_); |
| 105 if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings)) { | 103 // For non app (i.e. WebUI) windows (e.g. Settings) use MD frame color. |
| 106 // For non app (i.e. WebUI) windows (e.g. Settings) use MD frame color. | 104 if (!browser_view()->browser()->is_app()) |
| 107 if (!browser_view()->browser()->is_app()) | 105 header_painter->SetFrameColors(kMdWebUIFrameColor, kMdWebUIFrameColor); |
| 108 header_painter->SetFrameColors(kMdWebUIFrameColor, kMdWebUIFrameColor); | |
| 109 } | |
| 110 } else { | 106 } else { |
| 111 BrowserHeaderPainterAsh* header_painter = new BrowserHeaderPainterAsh; | 107 BrowserHeaderPainterAsh* header_painter = new BrowserHeaderPainterAsh; |
| 112 header_painter_.reset(header_painter); | 108 header_painter_.reset(header_painter); |
| 113 header_painter->Init(frame(), browser_view(), this, window_icon_, | 109 header_painter->Init(frame(), browser_view(), this, window_icon_, |
| 114 caption_button_container_); | 110 caption_button_container_); |
| 115 } | 111 } |
| 116 | 112 |
| 117 #if defined(OS_CHROMEOS) | 113 #if defined(OS_CHROMEOS) |
| 118 if (browser_view()->browser()->is_app()) { | 114 if (browser_view()->browser()->is_app()) { |
| 119 frame()->GetNativeWindow()->SetProperty( | 115 frame()->GetNativeWindow()->SetProperty( |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 toolbar_bounds.width(), 0); | 447 toolbar_bounds.width(), 0); |
| 452 BrowserView::Paint1pxHorizontalLine(canvas, GetToolbarTopSeparatorColor(), | 448 BrowserView::Paint1pxHorizontalLine(canvas, GetToolbarTopSeparatorColor(), |
| 453 separator_rect, true); | 449 separator_rect, true); |
| 454 | 450 |
| 455 // Toolbar/content separator. | 451 // Toolbar/content separator. |
| 456 toolbar_bounds.Inset(kClientEdgeThickness, 0); | 452 toolbar_bounds.Inset(kClientEdgeThickness, 0); |
| 457 BrowserView::Paint1pxHorizontalLine( | 453 BrowserView::Paint1pxHorizontalLine( |
| 458 canvas, tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR), | 454 canvas, tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR), |
| 459 toolbar_bounds, true); | 455 toolbar_bounds, true); |
| 460 } | 456 } |
| OLD | NEW |