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