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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 virtual views::ClientView* CreateClientView(views::Window* window); | 390 virtual views::ClientView* CreateClientView(views::Window* window); |
390 | 391 |
391 // Overridden from views::ClientView: | 392 // Overridden from views::ClientView: |
392 virtual bool CanClose() const; | 393 virtual bool CanClose() const; |
393 virtual int NonClientHitTest(const gfx::Point& point); | 394 virtual int NonClientHitTest(const gfx::Point& point); |
394 virtual gfx::Size GetMinimumSize(); | 395 virtual gfx::Size GetMinimumSize(); |
395 | 396 |
396 // InfoBarContainer::Delegate overrides | 397 // InfoBarContainer::Delegate overrides |
397 virtual void InfoBarSizeChanged(bool is_animating); | 398 virtual void InfoBarSizeChanged(bool is_animating); |
398 | 399 |
399 // TabContentsContainer::ReservedAreaDelegate overrides. | 400 // views::SingleSplitView::Observer overrides: |
400 virtual void UpdateReservedContentsRect(const TabContentsContainer* source); | 401 virtual bool SplitHandleMoved(views::SingleSplitView* view); |
401 | 402 |
402 protected: | 403 protected: |
403 // Appends to |toolbars| a pointer to each AccessiblePaneView that | 404 // Appends to |toolbars| a pointer to each AccessiblePaneView that |
404 // can be traversed using F6, in the order they should be traversed. | 405 // can be traversed using F6, in the order they should be traversed. |
405 // Abstracted here so that it can be extended for Chrome OS. | 406 // Abstracted here so that it can be extended for Chrome OS. |
406 virtual void GetAccessiblePanes( | 407 virtual void GetAccessiblePanes( |
407 std::vector<AccessiblePaneView*>* panes); | 408 std::vector<AccessiblePaneView*>* panes); |
408 | 409 |
409 // Save the current focused view to view storage | 410 // Save the current focused view to view storage |
410 void SaveFocusedView(); | 411 void SaveFocusedView(); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 void UpdateAcceleratorMetrics(const views::Accelerator& accelerator, | 516 void UpdateAcceleratorMetrics(const views::Accelerator& accelerator, |
516 int command_id); | 517 int command_id); |
517 | 518 |
518 // Invoked from TabSelectedAt or when instant is made active. Is | 519 // Invoked from TabSelectedAt or when instant is made active. Is |
519 // |change_tab_contents| is true, |new_contents| is added to the view | 520 // |change_tab_contents| is true, |new_contents| is added to the view |
520 // hierarchy, if |change_tab_contents| is false, it's assumed |new_contents| | 521 // hierarchy, if |change_tab_contents| is false, it's assumed |new_contents| |
521 // has already been added to the view hierarchy. | 522 // has already been added to the view hierarchy. |
522 void ProcessTabSelected(TabContentsWrapper* new_contents, | 523 void ProcessTabSelected(TabContentsWrapper* new_contents, |
523 bool change_tab_contents); | 524 bool change_tab_contents); |
524 | 525 |
| 526 // Exposes resize corner size to BrowserViewLayout. |
| 527 gfx::Size GetResizeCornerSize() const; |
| 528 |
525 // Last focused view that issued a tab traversal. | 529 // Last focused view that issued a tab traversal. |
526 int last_focused_view_storage_id_; | 530 int last_focused_view_storage_id_; |
527 | 531 |
528 // The BrowserFrame that hosts this view. | 532 // The BrowserFrame that hosts this view. |
529 BrowserFrame* frame_; | 533 BrowserFrame* frame_; |
530 | 534 |
531 // The Browser object we are associated with. | 535 // The Browser object we are associated with. |
532 scoped_ptr<Browser> browser_; | 536 scoped_ptr<Browser> browser_; |
533 | 537 |
534 // BrowserView layout (LTR one is pictured here). | 538 // BrowserView layout (LTR one is pictured here). |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; | 671 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; |
668 | 672 |
669 scoped_ptr<AccessibleViewHelper> accessible_view_helper_; | 673 scoped_ptr<AccessibleViewHelper> accessible_view_helper_; |
670 | 674 |
671 NotificationRegistrar registrar_; | 675 NotificationRegistrar registrar_; |
672 | 676 |
673 DISALLOW_COPY_AND_ASSIGN(BrowserView); | 677 DISALLOW_COPY_AND_ASSIGN(BrowserView); |
674 }; | 678 }; |
675 | 679 |
676 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ | 680 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ |
OLD | NEW |