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_VIEWS_FRAME_BROWSER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_ |
6 #define CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_ | 6 #define CHROME_BROWSER_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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 virtual void UpdateToolbar(TabContents* contents, bool should_restore_state); | 272 virtual void UpdateToolbar(TabContents* contents, bool should_restore_state); |
272 virtual void FocusToolbar(); | 273 virtual void FocusToolbar(); |
273 virtual void FocusAppMenu(); | 274 virtual void FocusAppMenu(); |
274 virtual void FocusBookmarksToolbar(); | 275 virtual void FocusBookmarksToolbar(); |
275 virtual void FocusChromeOSStatus() {} | 276 virtual void FocusChromeOSStatus() {} |
276 virtual void RotatePaneFocus(bool forwards); | 277 virtual void RotatePaneFocus(bool forwards); |
277 virtual void DestroyBrowser(); | 278 virtual void DestroyBrowser(); |
278 virtual bool IsBookmarkBarVisible() const; | 279 virtual bool IsBookmarkBarVisible() const; |
279 virtual bool IsBookmarkBarAnimating() const; | 280 virtual bool IsBookmarkBarAnimating() const; |
280 virtual bool IsToolbarVisible() const; | 281 virtual bool IsToolbarVisible() const; |
281 virtual gfx::Rect GetRootWindowResizerRect() const; | |
282 virtual void DisableInactiveFrame(); | 282 virtual void DisableInactiveFrame(); |
283 virtual void ConfirmSetDefaultSearchProvider( | 283 virtual void ConfirmSetDefaultSearchProvider( |
284 TabContents* tab_contents, | 284 TabContents* tab_contents, |
285 TemplateURL* template_url, | 285 TemplateURL* template_url, |
286 TemplateURLModel* template_url_model); | 286 TemplateURLModel* template_url_model); |
287 virtual void ConfirmAddSearchProvider(const TemplateURL* template_url, | 287 virtual void ConfirmAddSearchProvider(const TemplateURL* template_url, |
288 Profile* profile); | 288 Profile* profile); |
289 virtual void ToggleBookmarkBar(); | 289 virtual void ToggleBookmarkBar(); |
290 virtual views::Window* ShowAboutChromeDialog(); | 290 virtual views::Window* ShowAboutChromeDialog(); |
291 virtual void ShowUpdateChromeDialog(); | 291 virtual void ShowUpdateChromeDialog(); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 virtual views::ClientView* CreateClientView(views::Window* window); | 383 virtual views::ClientView* CreateClientView(views::Window* window); |
384 | 384 |
385 // Overridden from views::ClientView: | 385 // Overridden from views::ClientView: |
386 virtual bool CanClose() const; | 386 virtual bool CanClose() const; |
387 virtual int NonClientHitTest(const gfx::Point& point); | 387 virtual int NonClientHitTest(const gfx::Point& point); |
388 virtual gfx::Size GetMinimumSize(); | 388 virtual gfx::Size GetMinimumSize(); |
389 | 389 |
390 // InfoBarContainer::Delegate overrides | 390 // InfoBarContainer::Delegate overrides |
391 virtual void InfoBarSizeChanged(bool is_animating); | 391 virtual void InfoBarSizeChanged(bool is_animating); |
392 | 392 |
| 393 // TabContentsContainer::ReservedAreaDelegate overrides. |
| 394 virtual void UpdateReservedContentsRect(const TabContentsContainer* source); |
| 395 |
393 protected: | 396 protected: |
394 // Appends to |toolbars| a pointer to each AccessiblePaneView that | 397 // Appends to |toolbars| a pointer to each AccessiblePaneView that |
395 // can be traversed using F6, in the order they should be traversed. | 398 // can be traversed using F6, in the order they should be traversed. |
396 // Abstracted here so that it can be extended for Chrome OS. | 399 // Abstracted here so that it can be extended for Chrome OS. |
397 virtual void GetAccessiblePanes( | 400 virtual void GetAccessiblePanes( |
398 std::vector<AccessiblePaneView*>* panes); | 401 std::vector<AccessiblePaneView*>* panes); |
399 | 402 |
400 // Save the current focused view to view storage | 403 // Save the current focused view to view storage |
401 void SaveFocusedView(); | 404 void SaveFocusedView(); |
402 | 405 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; | 654 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; |
652 | 655 |
653 scoped_ptr<AccessibleViewHelper> accessible_view_helper_; | 656 scoped_ptr<AccessibleViewHelper> accessible_view_helper_; |
654 | 657 |
655 NotificationRegistrar registrar_; | 658 NotificationRegistrar registrar_; |
656 | 659 |
657 DISALLOW_COPY_AND_ASSIGN(BrowserView); | 660 DISALLOW_COPY_AND_ASSIGN(BrowserView); |
658 }; | 661 }; |
659 | 662 |
660 #endif // CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_ | 663 #endif // CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_ |
OLD | NEW |