| 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.h" | 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/app/vector_icons/vector_icons.h" |
| 8 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/profiles/avatar_menu.h" | 10 #include "chrome/browser/profiles/avatar_menu.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
| 12 #include "chrome/browser/themes/theme_properties.h" | 13 #include "chrome/browser/themes/theme_properties.h" |
| 13 #include "chrome/browser/ui/view_ids.h" | 14 #include "chrome/browser/ui/view_ids.h" |
| 14 #include "chrome/browser/ui/views/frame/browser_view.h" | 15 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 15 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 16 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 16 #include "chrome/grit/theme_resources.h" | 17 #include "chrome/grit/theme_resources.h" |
| 17 #include "components/signin/core/common/profile_management_switches.h" | 18 #include "components/signin/core/common/profile_management_switches.h" |
| 18 #include "third_party/skia/include/core/SkColor.h" | 19 #include "third_party/skia/include/core/SkColor.h" |
| 19 #include "ui/base/theme_provider.h" | 20 #include "ui/base/theme_provider.h" |
| 20 #include "ui/gfx/color_palette.h" | 21 #include "ui/gfx/color_palette.h" |
| 21 #include "ui/gfx/image/image.h" | 22 #include "ui/gfx/image/image.h" |
| 22 #include "ui/gfx/paint_vector_icon.h" | 23 #include "ui/gfx/paint_vector_icon.h" |
| 23 #include "ui/gfx/vector_icons_public.h" | |
| 24 #include "ui/views/background.h" | 24 #include "ui/views/background.h" |
| 25 | 25 |
| 26 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
| 27 #include "chrome/browser/ui/views/frame/taskbar_decorator_win.h" | 27 #include "chrome/browser/ui/views/frame/taskbar_decorator_win.h" |
| 28 #endif | 28 #endif |
| 29 | 29 |
| 30 BrowserNonClientFrameView::BrowserNonClientFrameView(BrowserFrame* frame, | 30 BrowserNonClientFrameView::BrowserNonClientFrameView(BrowserFrame* frame, |
| 31 BrowserView* browser_view) | 31 BrowserView* browser_view) |
| 32 : frame_(frame), | 32 : frame_(frame), |
| 33 browser_view_(browser_view), | 33 browser_view_(browser_view), |
| (...skipping 11 matching lines...) Expand all Loading... |
| 45 g_browser_process->profile_manager()-> | 45 g_browser_process->profile_manager()-> |
| 46 GetProfileAttributesStorage().RemoveObserver(this); | 46 GetProfileAttributesStorage().RemoveObserver(this); |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 | 49 |
| 50 void BrowserNonClientFrameView::OnBrowserViewInitViewsComplete() {} | 50 void BrowserNonClientFrameView::OnBrowserViewInitViewsComplete() {} |
| 51 | 51 |
| 52 gfx::ImageSkia BrowserNonClientFrameView::GetIncognitoAvatarIcon() const { | 52 gfx::ImageSkia BrowserNonClientFrameView::GetIncognitoAvatarIcon() const { |
| 53 const SkColor icon_color = color_utils::PickContrastingColor( | 53 const SkColor icon_color = color_utils::PickContrastingColor( |
| 54 SK_ColorWHITE, gfx::kChromeIconGrey, GetFrameColor()); | 54 SK_ColorWHITE, gfx::kChromeIconGrey, GetFrameColor()); |
| 55 return gfx::CreateVectorIcon(gfx::VectorIconId::INCOGNITO, icon_color); | 55 return gfx::CreateVectorIcon(kIncognitoIcon, icon_color); |
| 56 } | 56 } |
| 57 | 57 |
| 58 SkColor BrowserNonClientFrameView::GetToolbarTopSeparatorColor() const { | 58 SkColor BrowserNonClientFrameView::GetToolbarTopSeparatorColor() const { |
| 59 const auto color_id = | 59 const auto color_id = |
| 60 ShouldPaintAsActive() | 60 ShouldPaintAsActive() |
| 61 ? ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR | 61 ? ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR |
| 62 : ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR_INACTIVE; | 62 : ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR_INACTIVE; |
| 63 return ShouldPaintAsThemed() ? GetThemeProvider()->GetColor(color_id) | 63 return ShouldPaintAsThemed() ? GetThemeProvider()->GetColor(color_id) |
| 64 : ThemeProperties::GetDefaultColor( | 64 : ThemeProperties::GetDefaultColor( |
| 65 color_id, browser_view_->IsIncognito()); | 65 color_id, browser_view_->IsIncognito()); |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 // safety. See crbug.com/313800. | 269 // safety. See crbug.com/313800. |
| 270 gfx::Image decoration; | 270 gfx::Image decoration; |
| 271 AvatarMenu::GetImageForMenuButton( | 271 AvatarMenu::GetImageForMenuButton( |
| 272 browser_view()->browser()->profile()->GetPath(), &decoration); | 272 browser_view()->browser()->profile()->GetPath(), &decoration); |
| 273 // This can happen if the user deletes the current profile. | 273 // This can happen if the user deletes the current profile. |
| 274 if (decoration.IsEmpty()) | 274 if (decoration.IsEmpty()) |
| 275 return; | 275 return; |
| 276 chrome::DrawTaskbarDecoration(frame_->GetNativeWindow(), &decoration); | 276 chrome::DrawTaskbarDecoration(frame_->GetNativeWindow(), &decoration); |
| 277 #endif | 277 #endif |
| 278 } | 278 } |
| OLD | NEW |