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.h" | 17 #include "chrome/browser/browser.h" |
18 #include "chrome/browser/browser_window.h" | 18 #include "chrome/browser/browser_window.h" |
19 #include "chrome/browser/tabs/tab_strip_model_observer.h" | 19 #include "chrome/browser/tabs/tab_strip_model_observer.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" |
23 #include "chrome/browser/views/tabs/tab_strip.h" | 24 #include "chrome/browser/views/tabs/tab_strip.h" |
24 #include "chrome/browser/views/tabs/base_tab_strip.h" | 25 #include "chrome/browser/views/tabs/base_tab_strip.h" |
25 #include "chrome/browser/views/unhandled_keyboard_event_handler.h" | 26 #include "chrome/browser/views/unhandled_keyboard_event_handler.h" |
26 #include "chrome/common/notification_registrar.h" | 27 #include "chrome/common/notification_registrar.h" |
27 #include "gfx/native_widget_types.h" | 28 #include "gfx/native_widget_types.h" |
28 #include "views/window/client_view.h" | 29 #include "views/window/client_view.h" |
29 #include "views/window/window_delegate.h" | 30 #include "views/window/window_delegate.h" |
30 | 31 |
31 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
32 #include "chrome/browser/hang_monitor/hung_plugin_action.h" | 33 #include "chrome/browser/hang_monitor/hung_plugin_action.h" |
(...skipping 12 matching lines...) Expand all Loading... |
45 class BrowserViewLayout; | 46 class BrowserViewLayout; |
46 class ContentsContainer; | 47 class ContentsContainer; |
47 class DownloadShelfView; | 48 class DownloadShelfView; |
48 class EncodingMenuModel; | 49 class EncodingMenuModel; |
49 class FullscreenExitBubble; | 50 class FullscreenExitBubble; |
50 class HtmlDialogUIDelegate; | 51 class HtmlDialogUIDelegate; |
51 class InfoBarContainer; | 52 class InfoBarContainer; |
52 class LocationBarView; | 53 class LocationBarView; |
53 class SideTabStrip; | 54 class SideTabStrip; |
54 class StatusBubbleViews; | 55 class StatusBubbleViews; |
55 class TabContentsContainer; | |
56 class TabStripModel; | 56 class TabStripModel; |
57 class ToolbarView; | 57 class ToolbarView; |
58 class ZoomMenuModel; | 58 class ZoomMenuModel; |
59 | 59 |
60 #if defined(OS_WIN) | 60 #if defined(OS_WIN) |
61 class AeroPeekManager; | 61 class AeroPeekManager; |
62 class JumpList; | 62 class JumpList; |
63 #endif | 63 #endif |
64 | 64 |
65 namespace views { | 65 namespace views { |
66 class ExternalFocusTracker; | 66 class ExternalFocusTracker; |
67 class Menu; | 67 class Menu; |
68 class SingleSplitView; | 68 class SingleSplitView; |
69 } | 69 } |
70 | 70 |
71 /////////////////////////////////////////////////////////////////////////////// | 71 /////////////////////////////////////////////////////////////////////////////// |
72 // BrowserView | 72 // BrowserView |
73 // | 73 // |
74 // A ClientView subclass that provides the contents of a browser window, | 74 // A ClientView subclass that provides the contents of a browser window, |
75 // including the TabStrip, toolbars, download shelves, the content area etc. | 75 // including the TabStrip, toolbars, download shelves, the content area etc. |
76 // | 76 // |
77 class BrowserView : public BrowserBubbleHost, | 77 class BrowserView : public BrowserBubbleHost, |
78 public BrowserWindow, | 78 public BrowserWindow, |
79 public BrowserWindowTesting, | 79 public BrowserWindowTesting, |
80 public NotificationObserver, | 80 public NotificationObserver, |
81 public TabStripModelObserver, | 81 public TabStripModelObserver, |
82 public menus::SimpleMenuModel::Delegate, | 82 public menus::SimpleMenuModel::Delegate, |
83 public views::WindowDelegate, | 83 public views::WindowDelegate, |
84 public views::ClientView, | 84 public views::ClientView, |
85 public InfoBarContainer::Delegate { | 85 public InfoBarContainer::Delegate, |
| 86 public TabContentsContainer::ReservedAreaDelegate { |
86 public: | 87 public: |
87 // The browser view's class name. | 88 // The browser view's class name. |
88 static const char kViewClassName[]; | 89 static const char kViewClassName[]; |
89 | 90 |
90 // Explicitly sets how windows are shown. Use a value of -1 to give the | 91 // Explicitly sets how windows are shown. Use a value of -1 to give the |
91 // default behavior. This is used during testing and not generally useful | 92 // default behavior. This is used during testing and not generally useful |
92 // otherwise. | 93 // otherwise. |
93 static void SetShowState(int state); | 94 static void SetShowState(int state); |
94 | 95 |
95 explicit BrowserView(Browser* browser); | 96 explicit BrowserView(Browser* browser); |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 virtual void UpdateToolbar(TabContents* contents, bool should_restore_state); | 266 virtual void UpdateToolbar(TabContents* contents, bool should_restore_state); |
266 virtual void FocusToolbar(); | 267 virtual void FocusToolbar(); |
267 virtual void FocusAppMenu(); | 268 virtual void FocusAppMenu(); |
268 virtual void FocusBookmarksToolbar(); | 269 virtual void FocusBookmarksToolbar(); |
269 virtual void FocusChromeOSStatus() {} | 270 virtual void FocusChromeOSStatus() {} |
270 virtual void RotatePaneFocus(bool forwards); | 271 virtual void RotatePaneFocus(bool forwards); |
271 virtual void DestroyBrowser(); | 272 virtual void DestroyBrowser(); |
272 virtual bool IsBookmarkBarVisible() const; | 273 virtual bool IsBookmarkBarVisible() const; |
273 virtual bool IsBookmarkBarAnimating() const; | 274 virtual bool IsBookmarkBarAnimating() const; |
274 virtual bool IsToolbarVisible() const; | 275 virtual bool IsToolbarVisible() const; |
275 virtual gfx::Rect GetRootWindowResizerRect() const; | |
276 virtual void DisableInactiveFrame(); | 276 virtual void DisableInactiveFrame(); |
277 virtual void ConfirmSetDefaultSearchProvider( | 277 virtual void ConfirmSetDefaultSearchProvider( |
278 TabContents* tab_contents, | 278 TabContents* tab_contents, |
279 TemplateURL* template_url, | 279 TemplateURL* template_url, |
280 TemplateURLModel* template_url_model); | 280 TemplateURLModel* template_url_model); |
281 virtual void ConfirmAddSearchProvider(const TemplateURL* template_url, | 281 virtual void ConfirmAddSearchProvider(const TemplateURL* template_url, |
282 Profile* profile); | 282 Profile* profile); |
283 virtual void ToggleBookmarkBar(); | 283 virtual void ToggleBookmarkBar(); |
284 virtual views::Window* ShowAboutChromeDialog(); | 284 virtual views::Window* ShowAboutChromeDialog(); |
285 virtual void ShowUpdateChromeDialog(); | 285 virtual void ShowUpdateChromeDialog(); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 virtual views::ClientView* CreateClientView(views::Window* window); | 377 virtual views::ClientView* CreateClientView(views::Window* window); |
378 | 378 |
379 // Overridden from views::ClientView: | 379 // Overridden from views::ClientView: |
380 virtual bool CanClose() const; | 380 virtual bool CanClose() const; |
381 virtual int NonClientHitTest(const gfx::Point& point); | 381 virtual int NonClientHitTest(const gfx::Point& point); |
382 virtual gfx::Size GetMinimumSize(); | 382 virtual gfx::Size GetMinimumSize(); |
383 | 383 |
384 // InfoBarContainer::Delegate overrides | 384 // InfoBarContainer::Delegate overrides |
385 virtual void InfoBarSizeChanged(bool is_animating); | 385 virtual void InfoBarSizeChanged(bool is_animating); |
386 | 386 |
| 387 // TabContentsContainer::ReservedAreaDelegate overrides. |
| 388 virtual void UpdateReservedContentsRect(const TabContentsContainer* source); |
| 389 |
387 protected: | 390 protected: |
388 // Appends to |toolbars| a pointer to each AccessiblePaneView that | 391 // Appends to |toolbars| a pointer to each AccessiblePaneView that |
389 // can be traversed using F6, in the order they should be traversed. | 392 // can be traversed using F6, in the order they should be traversed. |
390 // Abstracted here so that it can be extended for Chrome OS. | 393 // Abstracted here so that it can be extended for Chrome OS. |
391 virtual void GetAccessiblePanes( | 394 virtual void GetAccessiblePanes( |
392 std::vector<AccessiblePaneView*>* panes); | 395 std::vector<AccessiblePaneView*>* panes); |
393 | 396 |
394 // Save the current focused view to view storage | 397 // Save the current focused view to view storage |
395 void SaveFocusedView(); | 398 void SaveFocusedView(); |
396 | 399 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; | 648 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; |
646 | 649 |
647 scoped_ptr<AccessibleViewHelper> accessible_view_helper_; | 650 scoped_ptr<AccessibleViewHelper> accessible_view_helper_; |
648 | 651 |
649 NotificationRegistrar registrar_; | 652 NotificationRegistrar registrar_; |
650 | 653 |
651 DISALLOW_COPY_AND_ASSIGN(BrowserView); | 654 DISALLOW_COPY_AND_ASSIGN(BrowserView); |
652 }; | 655 }; |
653 | 656 |
654 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ | 657 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ |
OLD | NEW |