Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_BASE_WINDOW_H_ | |
| 6 #define CHROME_BROWSER_UI_BASE_WINDOW_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <list> | |
|
sky
2012/02/22 21:46:25
Remove this.
stevenjb
2012/02/23 02:19:15
Done.
| |
| 10 | |
| 11 #include "base/compiler_specific.h" | |
| 12 | |
| 13 namespace gfx { | |
| 14 class Rect; | |
| 15 } | |
| 16 | |
| 17 // This API needs to be implemented by any window that might be accessed | |
| 18 // through chrome.windows or chrome.tabs (e.g. browser windows and panels). | |
| 19 | |
| 20 class BaseWindow { | |
| 21 public: | |
| 22 // Returns true if the window is currently the active/focused window. | |
| 23 virtual bool IsActive() const = 0; | |
| 24 | |
| 25 // TODO(beng): REMOVE? | |
|
sky
2012/02/22 21:46:25
If you need this, then I suspect the TODO is no lo
stevenjb
2012/02/23 02:19:15
Done.
| |
| 26 // Returns true if the frame is maximized (aka zoomed). | |
|
sky
2012/02/22 21:46:25
Be consistent. Use window every where to match the
stevenjb
2012/02/23 02:19:15
Done.
| |
| 27 virtual bool IsMaximized() const = 0; | |
| 28 | |
| 29 // Returns true if the frame is minimized. | |
| 30 virtual bool IsMinimized() const = 0; | |
| 31 | |
| 32 // Returns the nonmaximized bounds of the frame (even if the frame is | |
| 33 // currently maximized or minimized) in terms of the screen coordinates. | |
| 34 virtual gfx::Rect GetRestoredBounds() const = 0; | |
| 35 | |
| 36 // Retrieves the window's current bounds, including its frame. | |
| 37 // This will only differ from GetRestoredBounds() for maximized | |
| 38 // and minimized windows. | |
| 39 virtual gfx::Rect GetBounds() const = 0; | |
| 40 | |
| 41 // Shows the window, or activates it if it's already visible. | |
| 42 virtual void Show() = 0; | |
| 43 | |
| 44 // Show the window, but do not activate it. Does nothing if window | |
| 45 // is already visible. | |
| 46 virtual void ShowInactive() = 0; | |
| 47 | |
| 48 // Closes the window as soon as possible. The close action may be delayed | |
| 49 // if an operation is in progress (e.g. a drag operation). | |
| 50 virtual void Close() = 0; | |
| 51 | |
| 52 // Activates (brings to front) the window. Restores the window from minimized | |
| 53 // state if necessary. | |
| 54 virtual void Activate() = 0; | |
| 55 | |
| 56 // Deactivates the window, making the next window in the Z order the active | |
| 57 // window. | |
| 58 virtual void Deactivate() = 0; | |
| 59 | |
| 60 // Maximizes/minimizes/restores the window. | |
| 61 virtual void Maximize() = 0; | |
| 62 virtual void Minimize() = 0; | |
| 63 virtual void Restore() = 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 // Flashes the taskbar item associated with this frame. | |
| 69 // Set |flash| to true to initiate flashing, false to stop flashing. | |
| 70 virtual void FlashFrame(bool flash) = 0; | |
| 71 }; | |
| 72 | |
| 73 #endif // CHROME_BROWSER_UI_BASE_WINDOW_H_ | |
| OLD | NEW |