| 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 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 #include "content/public/common/content_switches.h" | 131 #include "content/public/common/content_switches.h" |
| 132 #include "grit/theme_resources.h" | 132 #include "grit/theme_resources.h" |
| 133 #include "ui/accessibility/ax_view_state.h" | 133 #include "ui/accessibility/ax_view_state.h" |
| 134 #include "ui/base/accelerators/accelerator.h" | 134 #include "ui/base/accelerators/accelerator.h" |
| 135 #include "ui/base/hit_test.h" | 135 #include "ui/base/hit_test.h" |
| 136 #include "ui/base/l10n/l10n_util.h" | 136 #include "ui/base/l10n/l10n_util.h" |
| 137 #include "ui/base/material_design/material_design_controller.h" | 137 #include "ui/base/material_design/material_design_controller.h" |
| 138 #include "ui/base/resource/resource_bundle.h" | 138 #include "ui/base/resource/resource_bundle.h" |
| 139 #include "ui/base/theme_provider.h" | 139 #include "ui/base/theme_provider.h" |
| 140 #include "ui/content_accelerators/accelerator_util.h" | 140 #include "ui/content_accelerators/accelerator_util.h" |
| 141 #include "ui/display/screen.h" |
| 141 #include "ui/events/event_utils.h" | 142 #include "ui/events/event_utils.h" |
| 142 #include "ui/gfx/canvas.h" | 143 #include "ui/gfx/canvas.h" |
| 143 #include "ui/gfx/color_utils.h" | 144 #include "ui/gfx/color_utils.h" |
| 144 #include "ui/gfx/geometry/rect_conversions.h" | 145 #include "ui/gfx/geometry/rect_conversions.h" |
| 145 #include "ui/gfx/scoped_canvas.h" | 146 #include "ui/gfx/scoped_canvas.h" |
| 146 #include "ui/gfx/screen.h" | |
| 147 #include "ui/strings/grit/ui_strings.h" | 147 #include "ui/strings/grit/ui_strings.h" |
| 148 #include "ui/views/controls/button/menu_button.h" | 148 #include "ui/views/controls/button/menu_button.h" |
| 149 #include "ui/views/controls/textfield/textfield.h" | 149 #include "ui/views/controls/textfield/textfield.h" |
| 150 #include "ui/views/controls/webview/webview.h" | 150 #include "ui/views/controls/webview/webview.h" |
| 151 #include "ui/views/focus/external_focus_tracker.h" | 151 #include "ui/views/focus/external_focus_tracker.h" |
| 152 #include "ui/views/focus/view_storage.h" | 152 #include "ui/views/focus/view_storage.h" |
| 153 #include "ui/views/layout/grid_layout.h" | 153 #include "ui/views/layout/grid_layout.h" |
| 154 #include "ui/views/widget/native_widget.h" | 154 #include "ui/views/widget/native_widget.h" |
| 155 #include "ui/views/widget/root_view.h" | 155 #include "ui/views/widget/root_view.h" |
| 156 #include "ui/views/widget/widget.h" | 156 #include "ui/views/widget/widget.h" |
| (...skipping 2461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2618 | 2618 |
| 2619 ui::AcceleratorProvider* BrowserView::GetAcceleratorProvider() { | 2619 ui::AcceleratorProvider* BrowserView::GetAcceleratorProvider() { |
| 2620 return this; | 2620 return this; |
| 2621 } | 2621 } |
| 2622 | 2622 |
| 2623 gfx::NativeView BrowserView::GetBubbleParentView() const { | 2623 gfx::NativeView BrowserView::GetBubbleParentView() const { |
| 2624 return GetWidget()->GetNativeView(); | 2624 return GetWidget()->GetNativeView(); |
| 2625 } | 2625 } |
| 2626 | 2626 |
| 2627 gfx::Point BrowserView::GetCursorPointInParent() const { | 2627 gfx::Point BrowserView::GetCursorPointInParent() const { |
| 2628 gfx::Point cursor_pos = gfx::Screen::GetScreen()->GetCursorScreenPoint(); | 2628 gfx::Point cursor_pos = display::Screen::GetScreen()->GetCursorScreenPoint(); |
| 2629 views::View::ConvertPointFromScreen(GetWidget()->GetRootView(), &cursor_pos); | 2629 views::View::ConvertPointFromScreen(GetWidget()->GetRootView(), &cursor_pos); |
| 2630 return cursor_pos; | 2630 return cursor_pos; |
| 2631 } | 2631 } |
| 2632 | 2632 |
| 2633 gfx::Rect BrowserView::GetClientAreaBoundsInScreen() const { | 2633 gfx::Rect BrowserView::GetClientAreaBoundsInScreen() const { |
| 2634 return GetWidget()->GetClientAreaBoundsInScreen(); | 2634 return GetWidget()->GetClientAreaBoundsInScreen(); |
| 2635 } | 2635 } |
| 2636 | 2636 |
| 2637 bool BrowserView::IsImmersiveModeEnabled() { | 2637 bool BrowserView::IsImmersiveModeEnabled() { |
| 2638 return immersive_mode_controller()->IsEnabled(); | 2638 return immersive_mode_controller()->IsEnabled(); |
| 2639 } | 2639 } |
| 2640 | 2640 |
| 2641 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { | 2641 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { |
| 2642 return top_container_->GetBoundsInScreen(); | 2642 return top_container_->GetBoundsInScreen(); |
| 2643 } | 2643 } |
| 2644 | 2644 |
| 2645 extensions::ActiveTabPermissionGranter* | 2645 extensions::ActiveTabPermissionGranter* |
| 2646 BrowserView::GetActiveTabPermissionGranter() { | 2646 BrowserView::GetActiveTabPermissionGranter() { |
| 2647 content::WebContents* web_contents = GetActiveWebContents(); | 2647 content::WebContents* web_contents = GetActiveWebContents(); |
| 2648 if (!web_contents) | 2648 if (!web_contents) |
| 2649 return nullptr; | 2649 return nullptr; |
| 2650 return extensions::TabHelper::FromWebContents(web_contents) | 2650 return extensions::TabHelper::FromWebContents(web_contents) |
| 2651 ->active_tab_permission_granter(); | 2651 ->active_tab_permission_granter(); |
| 2652 } | 2652 } |
| OLD | NEW |