OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "app/menus/simple_menu_model.h" | 13 #include "app/menus/simple_menu_model.h" |
14 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
15 #include "base/timer.h" | 15 #include "base/timer.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "chrome/browser/browser_window.h" | 17 #include "chrome/browser/browser_window.h" |
18 #include "chrome/browser/tabs/tab_strip_model_observer.h" | 18 #include "chrome/browser/tabs/tab_strip_model_observer.h" |
19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
20 #include "chrome/browser/ui/views/frame/browser_bubble_host.h" | 20 #include "chrome/browser/ui/views/frame/browser_bubble_host.h" |
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/infobars/infobar_container.h" | 22 #include "chrome/browser/ui/views/infobars/infobar_container.h" |
23 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" | 23 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" |
24 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 24 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
25 #include "chrome/browser/ui/views/tabs/base_tab_strip.h" | 25 #include "chrome/browser/ui/views/tabs/base_tab_strip.h" |
26 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" | 26 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" |
27 #include "chrome/common/notification_registrar.h" | 27 #include "chrome/common/notification_registrar.h" |
28 #include "gfx/native_widget_types.h" | 28 #include "gfx/native_widget_types.h" |
| 29 #include "views/controls/single_split_view.h" |
29 #include "views/window/client_view.h" | 30 #include "views/window/client_view.h" |
30 #include "views/window/window_delegate.h" | 31 #include "views/window/window_delegate.h" |
31 | 32 |
32 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
33 #include "chrome/browser/hang_monitor/hung_plugin_action.h" | 34 #include "chrome/browser/hang_monitor/hung_plugin_action.h" |
34 #include "chrome/browser/hang_monitor/hung_window_detector.h" | 35 #include "chrome/browser/hang_monitor/hung_window_detector.h" |
35 #include "views/controls/menu/native_menu_win.h" | 36 #include "views/controls/menu/native_menu_win.h" |
36 #endif | 37 #endif |
37 | 38 |
38 // NOTE: For more information about the objects and files in this directory, | 39 // NOTE: For more information about the objects and files in this directory, |
39 // view: http://dev.chromium.org/developers/design-documents/browser-window | 40 // view: http://dev.chromium.org/developers/design-documents/browser-window |
40 | 41 |
41 class AccessiblePaneView; | 42 class AccessiblePaneView; |
42 class AccessibleViewHelper; | 43 class AccessibleViewHelper; |
43 class BookmarkBarView; | 44 class BookmarkBarView; |
44 class Browser; | 45 class Browser; |
45 class BrowserBubble; | 46 class BrowserBubble; |
46 class BrowserViewLayout; | 47 class BrowserViewLayout; |
47 class ContentsContainer; | 48 class ContentsContainer; |
48 class DownloadShelfView; | 49 class DownloadShelfView; |
49 class EncodingMenuModel; | 50 class EncodingMenuModel; |
50 class FullscreenExitBubble; | 51 class FullscreenExitBubble; |
51 class HtmlDialogUIDelegate; | 52 class HtmlDialogUIDelegate; |
52 class InfoBarContainer; | 53 class InfoBarContainer; |
53 class LocationBarView; | 54 class LocationBarView; |
54 class SideTabStrip; | 55 class SideTabStrip; |
55 class StatusBubbleViews; | 56 class StatusBubbleViews; |
| 57 class TabContentsContainer; |
56 class TabStripModel; | 58 class TabStripModel; |
57 class ToolbarView; | 59 class ToolbarView; |
58 class ZoomMenuModel; | 60 class ZoomMenuModel; |
59 class Extension; | 61 class Extension; |
60 | 62 |
61 #if defined(OS_WIN) | 63 #if defined(OS_WIN) |
62 class AeroPeekManager; | 64 class AeroPeekManager; |
63 class JumpList; | 65 class JumpList; |
64 #endif | 66 #endif |
65 | 67 |
66 namespace views { | 68 namespace views { |
67 class ExternalFocusTracker; | 69 class ExternalFocusTracker; |
68 class Menu; | 70 class Menu; |
69 class SingleSplitView; | |
70 } | 71 } |
71 | 72 |
72 /////////////////////////////////////////////////////////////////////////////// | 73 /////////////////////////////////////////////////////////////////////////////// |
73 // BrowserView | 74 // BrowserView |
74 // | 75 // |
75 // A ClientView subclass that provides the contents of a browser window, | 76 // A ClientView subclass that provides the contents of a browser window, |
76 // including the TabStrip, toolbars, download shelves, the content area etc. | 77 // including the TabStrip, toolbars, download shelves, the content area etc. |
77 // | 78 // |
78 class BrowserView : public BrowserBubbleHost, | 79 class BrowserView : public BrowserBubbleHost, |
79 public BrowserWindow, | 80 public BrowserWindow, |
80 public BrowserWindowTesting, | 81 public BrowserWindowTesting, |
81 public NotificationObserver, | 82 public NotificationObserver, |
82 public TabStripModelObserver, | 83 public TabStripModelObserver, |
83 public menus::SimpleMenuModel::Delegate, | 84 public menus::SimpleMenuModel::Delegate, |
84 public views::WindowDelegate, | 85 public views::WindowDelegate, |
85 public views::ClientView, | 86 public views::ClientView, |
86 public InfoBarContainer::Delegate, | 87 public InfoBarContainer::Delegate, |
87 public TabContentsContainer::ReservedAreaDelegate { | 88 public views::SingleSplitView::Observer { |
88 public: | 89 public: |
89 // The browser view's class name. | 90 // The browser view's class name. |
90 static const char kViewClassName[]; | 91 static const char kViewClassName[]; |
91 | 92 |
92 // Explicitly sets how windows are shown. Use a value of -1 to give the | 93 // Explicitly sets how windows are shown. Use a value of -1 to give the |
93 // default behavior. This is used during testing and not generally useful | 94 // default behavior. This is used during testing and not generally useful |
94 // otherwise. | 95 // otherwise. |
95 static void SetShowState(int state); | 96 static void SetShowState(int state); |
96 | 97 |
97 explicit BrowserView(Browser* browser); | 98 explicit BrowserView(Browser* browser); |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 virtual views::ClientView* CreateClientView(views::Window* window); | 389 virtual views::ClientView* CreateClientView(views::Window* window); |
389 | 390 |
390 // Overridden from views::ClientView: | 391 // Overridden from views::ClientView: |
391 virtual bool CanClose() const; | 392 virtual bool CanClose() const; |
392 virtual int NonClientHitTest(const gfx::Point& point); | 393 virtual int NonClientHitTest(const gfx::Point& point); |
393 virtual gfx::Size GetMinimumSize(); | 394 virtual gfx::Size GetMinimumSize(); |
394 | 395 |
395 // InfoBarContainer::Delegate overrides | 396 // InfoBarContainer::Delegate overrides |
396 virtual void InfoBarSizeChanged(bool is_animating); | 397 virtual void InfoBarSizeChanged(bool is_animating); |
397 | 398 |
398 // TabContentsContainer::ReservedAreaDelegate overrides. | 399 // views::SingleSplitView::Observer overrides: |
399 virtual void UpdateReservedContentsRect(const TabContentsContainer* source); | 400 virtual bool SplitHandleMoved(views::SingleSplitView* view); |
400 | 401 |
401 protected: | 402 protected: |
402 // Appends to |toolbars| a pointer to each AccessiblePaneView that | 403 // Appends to |toolbars| a pointer to each AccessiblePaneView that |
403 // can be traversed using F6, in the order they should be traversed. | 404 // can be traversed using F6, in the order they should be traversed. |
404 // Abstracted here so that it can be extended for Chrome OS. | 405 // Abstracted here so that it can be extended for Chrome OS. |
405 virtual void GetAccessiblePanes( | 406 virtual void GetAccessiblePanes( |
406 std::vector<AccessiblePaneView*>* panes); | 407 std::vector<AccessiblePaneView*>* panes); |
407 | 408 |
408 // Save the current focused view to view storage | 409 // Save the current focused view to view storage |
409 void SaveFocusedView(); | 410 void SaveFocusedView(); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 void UpdateAcceleratorMetrics(const views::Accelerator& accelerator, | 515 void UpdateAcceleratorMetrics(const views::Accelerator& accelerator, |
515 int command_id); | 516 int command_id); |
516 | 517 |
517 // Invoked from TabSelectedAt or when instant is made active. Is | 518 // Invoked from TabSelectedAt or when instant is made active. Is |
518 // |change_tab_contents| is true, |new_contents| is added to the view | 519 // |change_tab_contents| is true, |new_contents| is added to the view |
519 // hierarchy, if |change_tab_contents| is false, it's assumed |new_contents| | 520 // hierarchy, if |change_tab_contents| is false, it's assumed |new_contents| |
520 // has already been added to the view hierarchy. | 521 // has already been added to the view hierarchy. |
521 void ProcessTabSelected(TabContentsWrapper* new_contents, | 522 void ProcessTabSelected(TabContentsWrapper* new_contents, |
522 bool change_tab_contents); | 523 bool change_tab_contents); |
523 | 524 |
| 525 // Exposes resize corner size to BrowserViewLayout. |
| 526 gfx::Size GetResizeCornerSize() const; |
| 527 |
524 // Last focused view that issued a tab traversal. | 528 // Last focused view that issued a tab traversal. |
525 int last_focused_view_storage_id_; | 529 int last_focused_view_storage_id_; |
526 | 530 |
527 // The BrowserFrame that hosts this view. | 531 // The BrowserFrame that hosts this view. |
528 BrowserFrame* frame_; | 532 BrowserFrame* frame_; |
529 | 533 |
530 // The Browser object we are associated with. | 534 // The Browser object we are associated with. |
531 scoped_ptr<Browser> browser_; | 535 scoped_ptr<Browser> browser_; |
532 | 536 |
533 // BrowserView layout (LTR one is pictured here). | 537 // BrowserView layout (LTR one is pictured here). |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; | 670 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; |
667 | 671 |
668 scoped_ptr<AccessibleViewHelper> accessible_view_helper_; | 672 scoped_ptr<AccessibleViewHelper> accessible_view_helper_; |
669 | 673 |
670 NotificationRegistrar registrar_; | 674 NotificationRegistrar registrar_; |
671 | 675 |
672 DISALLOW_COPY_AND_ASSIGN(BrowserView); | 676 DISALLOW_COPY_AND_ASSIGN(BrowserView); |
673 }; | 677 }; |
674 | 678 |
675 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ | 679 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ |
OLD | NEW |