| 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 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/ui/views/frame/browser_frame.h" | 21 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 22 #include "chrome/browser/ui/views/frame/contents_web_view.h" | 22 #include "chrome/browser/ui/views/frame/contents_web_view.h" |
| 23 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" | 23 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" |
| 24 #include "chrome/browser/ui/views/frame/scroll_end_effect_controller.h" | 24 #include "chrome/browser/ui/views/frame/scroll_end_effect_controller.h" |
| 25 #include "chrome/browser/ui/views/frame/web_contents_close_handler.h" | 25 #include "chrome/browser/ui/views/frame/web_contents_close_handler.h" |
| 26 #include "chrome/browser/ui/views/load_complete_listener.h" | 26 #include "chrome/browser/ui/views/load_complete_listener.h" |
| 27 #include "components/infobars/core/infobar_container.h" | 27 #include "components/infobars/core/infobar_container.h" |
| 28 #include "ui/base/accelerators/accelerator.h" | 28 #include "ui/base/accelerators/accelerator.h" |
| 29 #include "ui/base/models/simple_menu_model.h" | 29 #include "ui/base/models/simple_menu_model.h" |
| 30 #include "ui/gfx/native_widget_types.h" | 30 #include "ui/gfx/native_widget_types.h" |
| 31 #include "ui/gfx/sys_color_change_listener.h" | |
| 32 #include "ui/views/controls/button/button.h" | 31 #include "ui/views/controls/button/button.h" |
| 33 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" | 32 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" |
| 34 #include "ui/views/widget/widget_delegate.h" | 33 #include "ui/views/widget/widget_delegate.h" |
| 35 #include "ui/views/widget/widget_observer.h" | 34 #include "ui/views/widget/widget_observer.h" |
| 36 #include "ui/views/window/client_view.h" | 35 #include "ui/views/window/client_view.h" |
| 37 | 36 |
| 38 #if defined(OS_WIN) | 37 #if defined(OS_WIN) |
| 39 #include "chrome/browser/hang_monitor/hung_plugin_action.h" | 38 #include "chrome/browser/hang_monitor/hung_plugin_action.h" |
| 40 #include "chrome/browser/hang_monitor/hung_window_detector.h" | 39 #include "chrome/browser/hang_monitor/hung_window_detector.h" |
| 41 #endif | 40 #endif |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // including the TabStrip, toolbars, download shelves, the content area etc. | 88 // including the TabStrip, toolbars, download shelves, the content area etc. |
| 90 // | 89 // |
| 91 class BrowserView : public BrowserWindow, | 90 class BrowserView : public BrowserWindow, |
| 92 public BrowserWindowTesting, | 91 public BrowserWindowTesting, |
| 93 public TabStripModelObserver, | 92 public TabStripModelObserver, |
| 94 public ui::AcceleratorProvider, | 93 public ui::AcceleratorProvider, |
| 95 public views::WidgetDelegate, | 94 public views::WidgetDelegate, |
| 96 public views::WidgetObserver, | 95 public views::WidgetObserver, |
| 97 public views::ClientView, | 96 public views::ClientView, |
| 98 public infobars::InfoBarContainer::Delegate, | 97 public infobars::InfoBarContainer::Delegate, |
| 99 public gfx::SysColorChangeListener, | |
| 100 public LoadCompleteListener::Delegate, | 98 public LoadCompleteListener::Delegate, |
| 101 public OmniboxPopupModelObserver { | 99 public OmniboxPopupModelObserver { |
| 102 public: | 100 public: |
| 103 // The browser view's class name. | 101 // The browser view's class name. |
| 104 static const char kViewClassName[]; | 102 static const char kViewClassName[]; |
| 105 | 103 |
| 106 BrowserView(); | 104 BrowserView(); |
| 107 virtual ~BrowserView(); | 105 virtual ~BrowserView(); |
| 108 | 106 |
| 109 // Takes ownership of |browser|. | 107 // Takes ownership of |browser|. |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 // Overridden from views::ClientView: | 442 // Overridden from views::ClientView: |
| 445 virtual bool CanClose() OVERRIDE; | 443 virtual bool CanClose() OVERRIDE; |
| 446 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; | 444 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; |
| 447 virtual gfx::Size GetMinimumSize() OVERRIDE; | 445 virtual gfx::Size GetMinimumSize() OVERRIDE; |
| 448 | 446 |
| 449 // InfoBarContainer::Delegate overrides | 447 // InfoBarContainer::Delegate overrides |
| 450 virtual SkColor GetInfoBarSeparatorColor() const OVERRIDE; | 448 virtual SkColor GetInfoBarSeparatorColor() const OVERRIDE; |
| 451 virtual void InfoBarContainerStateChanged(bool is_animating) OVERRIDE; | 449 virtual void InfoBarContainerStateChanged(bool is_animating) OVERRIDE; |
| 452 virtual bool DrawInfoBarArrows(int* x) const OVERRIDE; | 450 virtual bool DrawInfoBarArrows(int* x) const OVERRIDE; |
| 453 | 451 |
| 454 // gfx::SysColorChangeListener overrides: | |
| 455 virtual void OnSysColorChange() OVERRIDE; | |
| 456 | |
| 457 // Overridden from views::View: | 452 // Overridden from views::View: |
| 458 virtual const char* GetClassName() const OVERRIDE; | 453 virtual const char* GetClassName() const OVERRIDE; |
| 459 virtual void Layout() OVERRIDE; | 454 virtual void Layout() OVERRIDE; |
| 460 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; | 455 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; |
| 461 virtual void ViewHierarchyChanged( | 456 virtual void ViewHierarchyChanged( |
| 462 const ViewHierarchyChangedDetails& details) OVERRIDE; | 457 const ViewHierarchyChangedDetails& details) OVERRIDE; |
| 463 virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; | 458 virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; |
| 464 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 459 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; |
| 460 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE; |
| 465 | 461 |
| 466 // Overridden from ui::AcceleratorTarget: | 462 // Overridden from ui::AcceleratorTarget: |
| 467 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 463 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
| 468 | 464 |
| 469 // OmniboxPopupModelObserver overrides | 465 // OmniboxPopupModelObserver overrides |
| 470 virtual void OnOmniboxPopupShownOrHidden() OVERRIDE; | 466 virtual void OnOmniboxPopupShownOrHidden() OVERRIDE; |
| 471 | 467 |
| 472 // Testing interface: | 468 // Testing interface: |
| 473 views::View* GetContentsContainerForTest() { return contents_container_; } | 469 views::View* GetContentsContainerForTest() { return contents_container_; } |
| 474 views::WebView* GetContentsWebViewForTest() { return contents_web_view_; } | 470 views::WebView* GetContentsWebViewForTest() { return contents_web_view_; } |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 base::TimeTicks last_animation_time_; | 728 base::TimeTicks last_animation_time_; |
| 733 | 729 |
| 734 // If this flag is set then SetFocusToLocationBar() will set focus to the | 730 // If this flag is set then SetFocusToLocationBar() will set focus to the |
| 735 // location bar even if the browser window is not active. | 731 // location bar even if the browser window is not active. |
| 736 bool force_location_bar_focus_; | 732 bool force_location_bar_focus_; |
| 737 | 733 |
| 738 scoped_ptr<ImmersiveModeController> immersive_mode_controller_; | 734 scoped_ptr<ImmersiveModeController> immersive_mode_controller_; |
| 739 | 735 |
| 740 scoped_ptr<ScrollEndEffectController> scroll_end_effect_controller_; | 736 scoped_ptr<ScrollEndEffectController> scroll_end_effect_controller_; |
| 741 | 737 |
| 742 gfx::ScopedSysColorChangeListener color_change_listener_; | |
| 743 | |
| 744 scoped_ptr<WebContentsCloseHandler> web_contents_close_handler_; | 738 scoped_ptr<WebContentsCloseHandler> web_contents_close_handler_; |
| 745 | 739 |
| 746 mutable base::WeakPtrFactory<BrowserView> activate_modal_dialog_factory_; | 740 mutable base::WeakPtrFactory<BrowserView> activate_modal_dialog_factory_; |
| 747 | 741 |
| 748 DISALLOW_COPY_AND_ASSIGN(BrowserView); | 742 DISALLOW_COPY_AND_ASSIGN(BrowserView); |
| 749 }; | 743 }; |
| 750 | 744 |
| 751 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ | 745 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ |
| OLD | NEW |