Chromium Code Reviews| Index: chrome/browser/ui/base_window.h |
| diff --git a/chrome/browser/ui/base_window.h b/chrome/browser/ui/base_window.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a34498e6f58048031440b1b0658fecb2ce57a1d2 |
| --- /dev/null |
| +++ b/chrome/browser/ui/base_window.h |
| @@ -0,0 +1,73 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_BASE_WINDOW_H_ |
| +#define CHROME_BROWSER_UI_BASE_WINDOW_H_ |
| +#pragma once |
| + |
| +#include <list> |
|
sky
2012/02/22 21:46:25
Remove this.
stevenjb
2012/02/23 02:19:15
Done.
|
| + |
| +#include "base/compiler_specific.h" |
| + |
| +namespace gfx { |
| +class Rect; |
| +} |
| + |
| +// This API needs to be implemented by any window that might be accessed |
| +// through chrome.windows or chrome.tabs (e.g. browser windows and panels). |
| + |
| +class BaseWindow { |
| + public: |
| + // Returns true if the window is currently the active/focused window. |
| + virtual bool IsActive() const = 0; |
| + |
| + // 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.
|
| + // 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.
|
| + virtual bool IsMaximized() const = 0; |
| + |
| + // Returns true if the frame is minimized. |
| + virtual bool IsMinimized() const = 0; |
| + |
| + // Returns the nonmaximized bounds of the frame (even if the frame is |
| + // currently maximized or minimized) in terms of the screen coordinates. |
| + virtual gfx::Rect GetRestoredBounds() const = 0; |
| + |
| + // Retrieves the window's current bounds, including its frame. |
| + // This will only differ from GetRestoredBounds() for maximized |
| + // and minimized windows. |
| + virtual gfx::Rect GetBounds() const = 0; |
| + |
| + // Shows the window, or activates it if it's already visible. |
| + virtual void Show() = 0; |
| + |
| + // Show the window, but do not activate it. Does nothing if window |
| + // is already visible. |
| + virtual void ShowInactive() = 0; |
| + |
| + // Closes the window as soon as possible. The close action may be delayed |
| + // if an operation is in progress (e.g. a drag operation). |
| + virtual void Close() = 0; |
| + |
| + // Activates (brings to front) the window. Restores the window from minimized |
| + // state if necessary. |
| + virtual void Activate() = 0; |
| + |
| + // Deactivates the window, making the next window in the Z order the active |
| + // window. |
| + virtual void Deactivate() = 0; |
| + |
| + // Maximizes/minimizes/restores the window. |
| + virtual void Maximize() = 0; |
| + virtual void Minimize() = 0; |
| + virtual void Restore() = 0; |
| + |
| + // Sets the window's size and position to the specified values. |
| + virtual void SetBounds(const gfx::Rect& bounds) = 0; |
| + |
| + // Flashes the taskbar item associated with this frame. |
| + // Set |flash| to true to initiate flashing, false to stop flashing. |
| + virtual void FlashFrame(bool flash) = 0; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_BASE_WINDOW_H_ |