| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_BROWSER_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_BROWSER_WINDOW_H_ |
| 6 #define CHROME_BROWSER_BROWSER_WINDOW_H_ | 6 #define CHROME_BROWSER_BROWSER_WINDOW_H_ |
| 7 | 7 |
| 8 class BookmarkBarView; | 8 class BookmarkBarView; |
| 9 class Browser; | 9 class Browser; |
| 10 class BrowserList; | 10 class BrowserList; |
| 11 class BrowserView; | 11 class BrowserView; |
| 12 class BrowserWindowTesting; | 12 class BrowserWindowTesting; |
| 13 class GoButton; | 13 class GURL; |
| 14 class LocationBarView; | 14 class LocationBarView; |
| 15 class HtmlDialogContentsDelegate; | 15 class HtmlDialogContentsDelegate; |
| 16 class Profile; | 16 class Profile; |
| 17 class StatusBubble; | 17 class StatusBubble; |
| 18 class TabContents; | 18 class TabContents; |
| 19 class TabStrip; | |
| 20 class ToolbarStarToggle; | |
| 21 | 19 |
| 22 namespace gfx { | 20 namespace gfx { |
| 23 class Rect; | 21 class Rect; |
| 24 } | 22 } |
| 25 | 23 |
| 26 //////////////////////////////////////////////////////////////////////////////// | 24 //////////////////////////////////////////////////////////////////////////////// |
| 27 // BrowserWindow interface | 25 // BrowserWindow interface |
| 28 // An interface implemented by the "view" of the Browser window. | 26 // An interface implemented by the "view" of the Browser window. |
| 29 // | 27 // |
| 30 // NOTE: all getters, save GetTabStrip(), may return NULL. | 28 // NOTE: all getters, save GetTabStrip(), may return NULL. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 52 virtual void FlashFrame() = 0; | 50 virtual void FlashFrame() = 0; |
| 53 | 51 |
| 54 // Return a platform dependent identifier for this frame. On Windows, this | 52 // Return a platform dependent identifier for this frame. On Windows, this |
| 55 // returns an HWND. DO NOT USE IN CROSS PLATFORM CODE. | 53 // returns an HWND. DO NOT USE IN CROSS PLATFORM CODE. |
| 56 virtual void* GetNativeHandle() = 0; | 54 virtual void* GetNativeHandle() = 0; |
| 57 | 55 |
| 58 // Returns a pointer to the testing interface to the Browser window, or NULL | 56 // Returns a pointer to the testing interface to the Browser window, or NULL |
| 59 // if there is none. | 57 // if there is none. |
| 60 virtual BrowserWindowTesting* GetBrowserWindowTesting() = 0; | 58 virtual BrowserWindowTesting* GetBrowserWindowTesting() = 0; |
| 61 | 59 |
| 62 // TODO(beng): REMOVE (obtain via BrowserFrame). | |
| 63 // Return the TabStrip associated with the frame. | |
| 64 virtual TabStrip* GetTabStrip() const = 0; | |
| 65 | |
| 66 // Return the status bubble associated with the frame | 60 // Return the status bubble associated with the frame |
| 67 virtual StatusBubble* GetStatusBubble() = 0; | 61 virtual StatusBubble* GetStatusBubble() = 0; |
| 68 | 62 |
| 69 // Inform the receiving frame that an animation has progressed in the | 63 // Inform the receiving frame that an animation has progressed in the |
| 70 // selected tab. | 64 // selected tab. |
| 71 // TODO(beng): Remove. Infobars/Boomarks bars should talk directly to | 65 // TODO(beng): Remove. Infobars/Boomarks bars should talk directly to |
| 72 // BrowserView. | 66 // BrowserView. |
| 73 virtual void SelectedTabToolbarSizeChanged(bool is_animating) = 0; | 67 virtual void SelectedTabToolbarSizeChanged(bool is_animating) = 0; |
| 74 | 68 |
| 75 // Inform the frame that the selected tab favicon or title has changed. Some | 69 // Inform the frame that the selected tab favicon or title has changed. Some |
| 76 // frames may need to refresh their title bar. | 70 // frames may need to refresh their title bar. |
| 77 // TODO(beng): make this pure virtual after XPFrame/VistaFrame retire. | 71 // TODO(beng): make this pure virtual after XPFrame/VistaFrame retire. |
| 78 virtual void UpdateTitleBar() = 0; | 72 virtual void UpdateTitleBar() = 0; |
| 79 | 73 |
| 80 // Update any loading animations running in the window. |should_animate| is | 74 // Update any loading animations running in the window. |should_animate| is |
| 81 // true if there are tabs loading and the animations should continue, false | 75 // true if there are tabs loading and the animations should continue, false |
| 82 // if there are no active loads and the animations should end. | 76 // if there are no active loads and the animations should end. |
| 83 virtual void UpdateLoadingAnimations(bool should_animate) = 0; | 77 virtual void UpdateLoadingAnimations(bool should_animate) = 0; |
| 84 | 78 |
| 79 // Sets the starred state for the current tab. |
| 80 virtual void SetStarredState(bool is_starred) = 0; |
| 81 |
| 85 // TODO(beng): RENAME (GetRestoredBounds) | 82 // TODO(beng): RENAME (GetRestoredBounds) |
| 86 // Returns the nonmaximized bounds of the frame (even if the frame is | 83 // Returns the nonmaximized bounds of the frame (even if the frame is |
| 87 // currently maximized or minimized) in terms of the screen coordinates. | 84 // currently maximized or minimized) in terms of the screen coordinates. |
| 88 virtual gfx::Rect GetNormalBounds() const = 0; | 85 virtual gfx::Rect GetNormalBounds() const = 0; |
| 89 | 86 |
| 90 // TODO(beng): REMOVE? | 87 // TODO(beng): REMOVE? |
| 91 // Returns true if the frame is maximized (aka zoomed). | 88 // Returns true if the frame is maximized (aka zoomed). |
| 92 virtual bool IsMaximized() = 0; | 89 virtual bool IsMaximized() = 0; |
| 93 | 90 |
| 94 // Returns the star button. | |
| 95 virtual ToolbarStarToggle* GetStarButton() const = 0; | |
| 96 | |
| 97 // Returns the location bar. | 91 // Returns the location bar. |
| 98 virtual LocationBarView* GetLocationBarView() const = 0; | 92 virtual LocationBarView* GetLocationBarView() const = 0; |
| 99 | 93 |
| 100 // Returns the go button. | 94 // Informs the view whether or not a load is in progress for the current tab. |
| 101 virtual GoButton* GetGoButton() const = 0; | 95 // The view can use this notification to update the go/stop button. |
| 96 virtual void UpdateStopGoState(bool is_loading) = 0; |
| 102 | 97 |
| 103 // Updates the toolbar with the state for the specified |contents|. | 98 // Updates the toolbar with the state for the specified |contents|. |
| 104 virtual void UpdateToolbar(TabContents* contents, | 99 virtual void UpdateToolbar(TabContents* contents, |
| 105 bool should_restore_state) = 0; | 100 bool should_restore_state) = 0; |
| 106 | 101 |
| 107 // Focuses the toolbar (for accessibility). | 102 // Focuses the toolbar (for accessibility). |
| 108 virtual void FocusToolbar() = 0; | 103 virtual void FocusToolbar() = 0; |
| 109 | 104 |
| 110 // Returns whether the bookmark bar is visible or not. | 105 // Returns whether the bookmark bar is visible or not. |
| 111 virtual bool IsBookmarkBarVisible() const = 0; | 106 virtual bool IsBookmarkBarVisible() const = 0; |
| 112 | 107 |
| 113 // Shows or hides the bookmark bar depending on its current visibility. | 108 // Shows or hides the bookmark bar depending on its current visibility. |
| 114 virtual void ToggleBookmarkBar() = 0; | 109 virtual void ToggleBookmarkBar() = 0; |
| 115 | 110 |
| 116 // Shows the About Chrome dialog box. | 111 // Shows the About Chrome dialog box. |
| 117 virtual void ShowAboutChromeDialog() = 0; | 112 virtual void ShowAboutChromeDialog() = 0; |
| 118 | 113 |
| 119 // Shows the Bookmark Manager window. | 114 // Shows the Bookmark Manager window. |
| 120 virtual void ShowBookmarkManager() = 0; | 115 virtual void ShowBookmarkManager() = 0; |
| 121 | 116 |
| 117 // Returns true if the Bookmark bubble is visible. |
| 118 virtual bool IsBookmarkBubbleVisible() const = 0; |
| 119 |
| 120 // Shows the Bookmark bubble. |url| is the URL being bookmarked, |
| 121 // |already_bookmarked| is true if the url is already bookmarked. |
| 122 virtual void ShowBookmarkBubble(const GURL& url, bool already_bookmarked) = 0; |
| 123 |
| 122 // Shows the Report a Bug dialog box. | 124 // Shows the Report a Bug dialog box. |
| 123 virtual void ShowReportBugDialog() = 0; | 125 virtual void ShowReportBugDialog() = 0; |
| 124 | 126 |
| 125 // Shows the Clear Browsing Data dialog box. | 127 // Shows the Clear Browsing Data dialog box. |
| 126 virtual void ShowClearBrowsingDataDialog() = 0; | 128 virtual void ShowClearBrowsingDataDialog() = 0; |
| 127 | 129 |
| 128 // Shows the Import Bookmarks & Settings dialog box. | 130 // Shows the Import Bookmarks & Settings dialog box. |
| 129 virtual void ShowImportDialog() = 0; | 131 virtual void ShowImportDialog() = 0; |
| 130 | 132 |
| 131 // Shows the Search Engines dialog box. | 133 // Shows the Search Engines dialog box. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 153 // UI used only by UI test automation. | 155 // UI used only by UI test automation. |
| 154 class BrowserWindowTesting { | 156 class BrowserWindowTesting { |
| 155 public: | 157 public: |
| 156 #if defined(OS_WIN) | 158 #if defined(OS_WIN) |
| 157 // Returns the Bookmark Bar view. | 159 // Returns the Bookmark Bar view. |
| 158 virtual BookmarkBarView* GetBookmarkBarView() = 0; | 160 virtual BookmarkBarView* GetBookmarkBarView() = 0; |
| 159 #endif | 161 #endif |
| 160 }; | 162 }; |
| 161 | 163 |
| 162 #endif // CHROME_BROWSER_BROWSER_WINDOW_H__ | 164 #endif // CHROME_BROWSER_BROWSER_WINDOW_H__ |
| OLD | NEW |