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_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
675 } | 675 } |
676 | 676 |
677 WebContents* BrowserView::GetActiveWebContents() const { | 677 WebContents* BrowserView::GetActiveWebContents() const { |
678 return browser_->tab_strip_model()->GetActiveWebContents(); | 678 return browser_->tab_strip_model()->GetActiveWebContents(); |
679 } | 679 } |
680 | 680 |
681 gfx::ImageSkia BrowserView::GetOTRAvatarIcon() const { | 681 gfx::ImageSkia BrowserView::GetOTRAvatarIcon() const { |
682 if (ui::MaterialDesignController::IsModeMaterial()) { | 682 if (ui::MaterialDesignController::IsModeMaterial()) { |
683 SkColor icon_color = SK_ColorWHITE; | 683 SkColor icon_color = SK_ColorWHITE; |
684 #if defined(OS_WIN) | 684 #if defined(OS_WIN) |
685 // On Windows 10, we can't change the frame color so must assume it's white. | 685 // On Windows 10+, we assume the native frame color is white. |
686 if (base::win::GetVersion() == base::win::VERSION_WIN10) | 686 // TODO(pkasting): Read the correct frame color from the registry or APIs. |
687 if (GetWidget() && GetWidget()->ShouldUseNativeFrame() && | |
Evan Stade
2016/02/10 22:45:37
nit: i prefer curlies in this case (multi-line con
| |
688 (base::win::GetVersion() >= base::win::VERSION_WIN10)) | |
687 icon_color = gfx::kChromeIconGrey; | 689 icon_color = gfx::kChromeIconGrey; |
688 #endif | 690 #endif |
689 return gfx::CreateVectorIcon(gfx::VectorIconId::INCOGNITO, 24, icon_color); | 691 return gfx::CreateVectorIcon(gfx::VectorIconId::INCOGNITO, 24, icon_color); |
690 } | 692 } |
691 | 693 |
692 // GetThemeProvider() can return null if this view is not yet part of the | 694 // GetThemeProvider() can return null if this view is not yet part of the |
693 // widget hierarchy, but the frame's theme provider is always valid. | 695 // widget hierarchy, but the frame's theme provider is always valid. |
694 return *frame_->GetThemeProvider()->GetImageSkiaNamed(IDR_OTR_ICON); | 696 return *frame_->GetThemeProvider()->GetImageSkiaNamed(IDR_OTR_ICON); |
695 } | 697 } |
696 | 698 |
(...skipping 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2697 return GetWidget()->GetClientAreaBoundsInScreen(); | 2699 return GetWidget()->GetClientAreaBoundsInScreen(); |
2698 } | 2700 } |
2699 | 2701 |
2700 bool BrowserView::IsImmersiveModeEnabled() { | 2702 bool BrowserView::IsImmersiveModeEnabled() { |
2701 return immersive_mode_controller()->IsEnabled(); | 2703 return immersive_mode_controller()->IsEnabled(); |
2702 } | 2704 } |
2703 | 2705 |
2704 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { | 2706 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { |
2705 return top_container_->GetBoundsInScreen(); | 2707 return top_container_->GetBoundsInScreen(); |
2706 } | 2708 } |
OLD | NEW |