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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 #include "ui/base/hit_test.h" | 127 #include "ui/base/hit_test.h" |
128 #include "ui/base/l10n/l10n_util.h" | 128 #include "ui/base/l10n/l10n_util.h" |
129 #include "ui/base/resource/material_design/material_design_controller.h" | 129 #include "ui/base/resource/material_design/material_design_controller.h" |
130 #include "ui/base/resource/resource_bundle.h" | 130 #include "ui/base/resource/resource_bundle.h" |
131 #include "ui/base/theme_provider.h" | 131 #include "ui/base/theme_provider.h" |
132 #include "ui/content_accelerators/accelerator_util.h" | 132 #include "ui/content_accelerators/accelerator_util.h" |
133 #include "ui/events/event_utils.h" | 133 #include "ui/events/event_utils.h" |
134 #include "ui/gfx/canvas.h" | 134 #include "ui/gfx/canvas.h" |
135 #include "ui/gfx/color_utils.h" | 135 #include "ui/gfx/color_utils.h" |
136 #include "ui/gfx/geometry/rect_conversions.h" | 136 #include "ui/gfx/geometry/rect_conversions.h" |
137 #include "ui/gfx/paint_vector_icon.h" | |
137 #include "ui/gfx/scoped_canvas.h" | 138 #include "ui/gfx/scoped_canvas.h" |
138 #include "ui/gfx/screen.h" | 139 #include "ui/gfx/screen.h" |
140 #include "ui/gfx/vector_icons_public.h" | |
139 #include "ui/strings/grit/ui_strings.h" | 141 #include "ui/strings/grit/ui_strings.h" |
140 #include "ui/views/controls/button/menu_button.h" | 142 #include "ui/views/controls/button/menu_button.h" |
141 #include "ui/views/controls/textfield/textfield.h" | 143 #include "ui/views/controls/textfield/textfield.h" |
142 #include "ui/views/controls/webview/webview.h" | 144 #include "ui/views/controls/webview/webview.h" |
143 #include "ui/views/focus/external_focus_tracker.h" | 145 #include "ui/views/focus/external_focus_tracker.h" |
144 #include "ui/views/focus/view_storage.h" | 146 #include "ui/views/focus/view_storage.h" |
145 #include "ui/views/layout/grid_layout.h" | 147 #include "ui/views/layout/grid_layout.h" |
146 #include "ui/views/widget/native_widget.h" | 148 #include "ui/views/widget/native_widget.h" |
147 #include "ui/views/widget/root_view.h" | 149 #include "ui/views/widget/root_view.h" |
148 #include "ui/views/widget/widget.h" | 150 #include "ui/views/widget/widget.h" |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
675 | 677 |
676 bool BrowserView::IsAcceleratorRegistered(const ui::Accelerator& accelerator) { | 678 bool BrowserView::IsAcceleratorRegistered(const ui::Accelerator& accelerator) { |
677 return accelerator_table_.find(accelerator) != accelerator_table_.end(); | 679 return accelerator_table_.find(accelerator) != accelerator_table_.end(); |
678 } | 680 } |
679 | 681 |
680 WebContents* BrowserView::GetActiveWebContents() const { | 682 WebContents* BrowserView::GetActiveWebContents() const { |
681 return browser_->tab_strip_model()->GetActiveWebContents(); | 683 return browser_->tab_strip_model()->GetActiveWebContents(); |
682 } | 684 } |
683 | 685 |
684 gfx::ImageSkia BrowserView::GetOTRAvatarIcon() const { | 686 gfx::ImageSkia BrowserView::GetOTRAvatarIcon() const { |
687 if (ui::MaterialDesignController::IsModeMaterial()) { | |
688 return gfx::CreateVectorIcon(gfx::VectorIconId::INCOGNITO, 24, | |
689 SK_ColorWHITE); | |
Peter Kasting
2015/11/17 21:07:58
Does this work on Win 10 where the frame color is
Evan Stade
2015/11/17 21:34:23
The mocks Sebastien provided show a black frame fo
Peter Kasting
2015/11/17 21:48:31
It's currently not technically possible to impleme
| |
690 } | |
691 | |
685 return *GetThemeProvider()->GetImageSkiaNamed(IDR_OTR_ICON); | 692 return *GetThemeProvider()->GetImageSkiaNamed(IDR_OTR_ICON); |
686 } | 693 } |
687 | 694 |
688 /////////////////////////////////////////////////////////////////////////////// | 695 /////////////////////////////////////////////////////////////////////////////// |
689 // BrowserView, BrowserWindow implementation: | 696 // BrowserView, BrowserWindow implementation: |
690 | 697 |
691 void BrowserView::Show() { | 698 void BrowserView::Show() { |
692 #if !defined(OS_WIN) | 699 #if !defined(OS_WIN) |
693 // The Browser associated with this browser window must become the active | 700 // The Browser associated with this browser window must become the active |
694 // browser at the time |Show()| is called. This is the natural behavior under | 701 // browser at the time |Show()| is called. This is the natural behavior under |
(...skipping 1962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2657 return immersive_mode_controller()->IsEnabled(); | 2664 return immersive_mode_controller()->IsEnabled(); |
2658 } | 2665 } |
2659 | 2666 |
2660 views::Widget* BrowserView::GetBubbleAssociatedWidget() { | 2667 views::Widget* BrowserView::GetBubbleAssociatedWidget() { |
2661 return GetWidget(); | 2668 return GetWidget(); |
2662 } | 2669 } |
2663 | 2670 |
2664 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { | 2671 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { |
2665 return top_container_->GetBoundsInScreen(); | 2672 return top_container_->GetBoundsInScreen(); |
2666 } | 2673 } |
OLD | NEW |