Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BROWSER_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_WINDOW_H_ |
| 6 #define CHROME_BROWSER_UI_BROWSER_WINDOW_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_WINDOW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/ui/base_window.h" | |
| 9 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" | 10 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
| 10 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" | 11 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" |
| 11 #include "chrome/common/content_settings_types.h" | 12 #include "chrome/common/content_settings_types.h" |
| 12 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
| 13 #include "webkit/glue/window_open_disposition.h" | 14 #include "webkit/glue/window_open_disposition.h" |
| 14 | 15 |
| 15 class Browser; | 16 class Browser; |
| 16 class BrowserWindowTesting; | 17 class BrowserWindowTesting; |
| 17 class DownloadShelf; | 18 class DownloadShelf; |
| 18 class FindBar; | 19 class FindBar; |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 41 class Extension; | 42 class Extension; |
| 42 | 43 |
| 43 enum DevToolsDockSide { | 44 enum DevToolsDockSide { |
| 44 DEVTOOLS_DOCK_SIDE_BOTTOM = 0, | 45 DEVTOOLS_DOCK_SIDE_BOTTOM = 0, |
| 45 DEVTOOLS_DOCK_SIDE_RIGHT = 1 | 46 DEVTOOLS_DOCK_SIDE_RIGHT = 1 |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 //////////////////////////////////////////////////////////////////////////////// | 49 //////////////////////////////////////////////////////////////////////////////// |
| 49 // BrowserWindow interface | 50 // BrowserWindow interface |
| 50 // An interface implemented by the "view" of the Browser window. | 51 // An interface implemented by the "view" of the Browser window. |
| 52 // This interface includes BaseWindow methods as well as Browser window | |
| 53 // specific methods. | |
| 51 // | 54 // |
| 52 // NOTE: All getters may return NULL. | 55 // NOTE: All getters may return NULL. |
| 53 class BrowserWindow { | 56 // |
| 57 class BrowserWindow : public BaseWindow { | |
| 54 public: | 58 public: |
| 55 virtual ~BrowserWindow() {} | 59 virtual ~BrowserWindow() {} |
| 56 | 60 |
| 57 // Show the window, or activates it if it's already visible. | 61 ////////////////////////////////////////////////////////////////////////////// |
| 58 // Browser::OnWindowDidShow should be called after showing the window. | 62 // BaseWindow interface notes: |
| 59 virtual void Show() = 0; | |
| 60 | 63 |
| 61 // Show the window, but do not activate it. Does nothing if window | 64 // Closes the window as soon as possible. If the window is not in a drag |
| 62 // is already visible. | |
| 63 virtual void ShowInactive() = 0; | |
| 64 | |
| 65 // Sets the window's size and position to the specified values. | |
| 66 virtual void SetBounds(const gfx::Rect& bounds) = 0; | |
| 67 | |
| 68 // Closes the frame as soon as possible. If the frame is not in a drag | |
| 69 // session, it will close immediately; otherwise, it will move offscreen (so | 65 // session, it will close immediately; otherwise, it will move offscreen (so |
| 70 // events are still fired) until the drag ends, then close. This assumes | 66 // events are still fired) until the drag ends, then close. This assumes |
| 71 // that the Browser is not immediately destroyed, but will be eventually | 67 // that the Browser is not immediately destroyed, but will be eventually |
| 72 // destroyed by other means (eg, the tab strip going to zero elements). | 68 // destroyed by other means (eg, the tab strip going to zero elements). |
| 73 // Bad things happen if the Browser dtor is called directly as a result of | 69 // Bad things happen if the Browser dtor is called directly as a result of |
| 74 // invoking this method. | 70 // invoking this method. |
| 75 virtual void Close() = 0; | 71 virtual void Close() = 0; |
|
jennb
2012/02/24 05:18:43
Doesn't this cause problems to have the same name
stevenjb
2012/02/24 19:25:06
All this does is override a pure virtual with a pu
| |
| 76 | 72 |
| 77 // Activates (brings to front) the window. Restores the window from minimized | 73 // Browser::OnWindowDidShow should be called after showing the window. |
| 78 // state if necessary. | 74 virtual void Show() = 0; |
| 79 virtual void Activate() = 0; | |
| 80 | 75 |
| 81 // Deactivates the window, making the next window in the Z order the active | 76 ////////////////////////////////////////////////////////////////////////////// |
| 82 // window. | 77 // Browser specific methods: |
| 83 virtual void Deactivate() = 0; | |
| 84 | |
| 85 // Returns true if the window is currently the active/focused window. | |
| 86 virtual bool IsActive() const = 0; | |
| 87 | |
| 88 // Flashes the taskbar item associated with this frame. | |
| 89 // Set |flash| to true to initiate flashing, false to stop flashing. | |
| 90 virtual void FlashFrame(bool flash) = 0; | |
| 91 | 78 |
| 92 // Return a platform dependent identifier for this frame. On Windows, this | 79 // Return a platform dependent identifier for this frame. On Windows, this |
| 93 // returns an HWND. | 80 // returns an HWND. |
| 94 virtual gfx::NativeWindow GetNativeHandle() = 0; | 81 virtual gfx::NativeWindow GetNativeHandle() = 0; |
| 95 | 82 |
| 96 // Returns a pointer to the testing interface to the Browser window, or NULL | 83 // Returns a pointer to the testing interface to the Browser window, or NULL |
| 97 // if there is none. | 84 // if there is none. |
| 98 virtual BrowserWindowTesting* GetBrowserWindowTesting() = 0; | 85 virtual BrowserWindowTesting* GetBrowserWindowTesting() = 0; |
| 99 | 86 |
| 100 // Return the status bubble associated with the frame | 87 // Return the status bubble associated with the frame |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 123 virtual void SetDevToolsDockSide(DevToolsDockSide side) = 0; | 110 virtual void SetDevToolsDockSide(DevToolsDockSide side) = 0; |
| 124 | 111 |
| 125 // Update any loading animations running in the window. |should_animate| is | 112 // Update any loading animations running in the window. |should_animate| is |
| 126 // true if there are tabs loading and the animations should continue, false | 113 // true if there are tabs loading and the animations should continue, false |
| 127 // if there are no active loads and the animations should end. | 114 // if there are no active loads and the animations should end. |
| 128 virtual void UpdateLoadingAnimations(bool should_animate) = 0; | 115 virtual void UpdateLoadingAnimations(bool should_animate) = 0; |
| 129 | 116 |
| 130 // Sets the starred state for the current tab. | 117 // Sets the starred state for the current tab. |
| 131 virtual void SetStarredState(bool is_starred) = 0; | 118 virtual void SetStarredState(bool is_starred) = 0; |
| 132 | 119 |
| 133 // Returns the nonmaximized bounds of the frame (even if the frame is | |
| 134 // currently maximized or minimized) in terms of the screen coordinates. | |
| 135 virtual gfx::Rect GetRestoredBounds() const = 0; | |
| 136 | |
| 137 // Retrieves the window's current bounds, including its frame. | |
| 138 // This will only differ from GetRestoredBounds() for maximized | |
| 139 // and minimized windows. | |
| 140 virtual gfx::Rect GetBounds() const = 0; | |
| 141 | |
| 142 // TODO(beng): REMOVE? | |
| 143 // Returns true if the frame is maximized (aka zoomed). | |
| 144 virtual bool IsMaximized() const = 0; | |
| 145 | |
| 146 // Returns true if the frame is minimized. | |
| 147 virtual bool IsMinimized() const = 0; | |
| 148 | |
| 149 // Maximizes/minimizes/restores the window. | |
| 150 virtual void Maximize() = 0; | |
| 151 virtual void Minimize() = 0; | |
| 152 virtual void Restore() = 0; | |
| 153 | |
| 154 // Accessors for fullscreen mode state. | 120 // Accessors for fullscreen mode state. |
| 155 virtual void EnterFullscreen(const GURL& url, | 121 virtual void EnterFullscreen(const GURL& url, |
| 156 FullscreenExitBubbleType bubble_type) = 0; | 122 FullscreenExitBubbleType bubble_type) = 0; |
| 157 virtual void ExitFullscreen() = 0; | 123 virtual void ExitFullscreen() = 0; |
| 158 virtual void UpdateFullscreenExitBubbleContent( | 124 virtual void UpdateFullscreenExitBubbleContent( |
| 159 const GURL& url, | 125 const GURL& url, |
| 160 FullscreenExitBubbleType bubble_type) = 0; | 126 FullscreenExitBubbleType bubble_type) = 0; |
| 161 virtual bool IsFullscreen() const = 0; | 127 virtual bool IsFullscreen() const = 0; |
| 162 | 128 |
| 163 // Returns true if the fullscreen bubble is visible. | 129 // Returns true if the fullscreen bubble is visible. |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 413 | 379 |
| 414 // Returns the ToolbarView. | 380 // Returns the ToolbarView. |
| 415 virtual ToolbarView* GetToolbarView() const = 0; | 381 virtual ToolbarView* GetToolbarView() const = 0; |
| 416 #endif | 382 #endif |
| 417 | 383 |
| 418 protected: | 384 protected: |
| 419 virtual ~BrowserWindowTesting() {} | 385 virtual ~BrowserWindowTesting() {} |
| 420 }; | 386 }; |
| 421 | 387 |
| 422 #endif // CHROME_BROWSER_UI_BROWSER_WINDOW_H_ | 388 #endif // CHROME_BROWSER_UI_BROWSER_WINDOW_H_ |
| OLD | NEW |