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 "base/compiler_specific.h" |
| 10 |
| 11 namespace gfx { |
| 12 class Rect; |
| 13 } |
| 14 |
| 15 // This API needs to be implemented by any window that might be accessed |
| 16 // through chrome.windows or chrome.tabs (e.g. browser windows and panels). |
| 17 |
| 18 class BaseWindow { |
| 19 public: |
| 20 // Returns true if the window is currently the active/focused window. |
| 21 virtual bool IsActive() const = 0; |
| 22 |
| 23 // Returns true if the window is maximized (aka zoomed). |
| 24 virtual bool IsMaximized() const = 0; |
| 25 |
| 26 // Returns true if the window is minimized. |
| 27 virtual bool IsMinimized() const = 0; |
| 28 |
| 29 // Returns the nonmaximized bounds of the window (even if the window is |
| 30 // currently maximized or minimized) in terms of the screen coordinates. |
| 31 virtual gfx::Rect GetRestoredBounds() const = 0; |
| 32 |
| 33 // Retrieves the window's current bounds, including its window. |
| 34 // This will only differ from GetRestoredBounds() for maximized |
| 35 // and minimized windows. |
| 36 virtual gfx::Rect GetBounds() const = 0; |
| 37 |
| 38 // Shows the window, or activates it if it's already visible. |
| 39 virtual void Show() = 0; |
| 40 |
| 41 // Show the window, but do not activate it. Does nothing if window |
| 42 // is already visible. |
| 43 virtual void ShowInactive() = 0; |
| 44 |
| 45 // Closes the window as soon as possible. The close action may be delayed |
| 46 // if an operation is in progress (e.g. a drag operation). |
| 47 virtual void Close() = 0; |
| 48 |
| 49 // Activates (brings to front) the window. Restores the window from minimized |
| 50 // state if necessary. |
| 51 virtual void Activate() = 0; |
| 52 |
| 53 // Deactivates the window, making the next window in the Z order the active |
| 54 // window. |
| 55 virtual void Deactivate() = 0; |
| 56 |
| 57 // Maximizes/minimizes/restores the window. |
| 58 virtual void Maximize() = 0; |
| 59 virtual void Minimize() = 0; |
| 60 virtual void Restore() = 0; |
| 61 |
| 62 // Sets the window's size and position to the specified values. |
| 63 virtual void SetBounds(const gfx::Rect& bounds) = 0; |
| 64 |
| 65 // Flashes the taskbar item associated with this window. |
| 66 // Set |flash| to true to initiate flashing, false to stop flashing. |
| 67 virtual void FlashFrame(bool flash) = 0; |
| 68 }; |
| 69 |
| 70 #endif // CHROME_BROWSER_UI_BASE_WINDOW_H_ |
OLD | NEW |