summaryrefslogtreecommitdiffstats
path: root/views/window/window.h
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-13 19:03:31 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-13 19:03:31 +0000
commit9a56a0d8a1304ce392580319a066c0c1857a210e (patch)
tree188158d67d2446f7969f2dff588a6cfa02968974 /views/window/window.h
parent1357ae79b9d474da177632a85227efb676c6d98e (diff)
downloadchromium_src-9a56a0d8a1304ce392580319a066c0c1857a210e.zip
chromium_src-9a56a0d8a1304ce392580319a066c0c1857a210e.tar.gz
chromium_src-9a56a0d8a1304ce392580319a066c0c1857a210e.tar.bz2
Re-land:
Split the hierarchy. Now with AutocompletePopup implementing SupportsWeakPtr as before. This fixes the Windows XP crashes in browser_tests. BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7015051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85298 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/window/window.h')
-rw-r--r--views/window/window.h32
1 files changed, 6 insertions, 26 deletions
diff --git a/views/window/window.h b/views/window/window.h
index 76fdb76..191aba4 100644
--- a/views/window/window.h
+++ b/views/window/window.h
@@ -39,7 +39,8 @@ class WindowDelegate;
// implementation. Multiple inheritance is required for this
// transitional step.
//
-class Window : public internal::NativeWindowDelegate {
+class Window : public Widget,
+ public internal::NativeWindowDelegate {
public:
struct InitParams {
// |window_delegate| cannot be NULL.
@@ -71,16 +72,6 @@ class Window : public internal::NativeWindowDelegate {
static gfx::Size GetLocalizedContentsSize(int col_resource_id,
int row_resource_id);
- // Closes all windows that aren't identified as "app windows" via
- // IsAppWindow. Called during application shutdown when the last "app window"
- // is closed.
- static void CloseAllSecondaryWindows();
-
- // Used by |CloseAllSecondaryWindows|. If |widget|'s window is a secondary
- // window, the window is closed. If |widget| has no window, it is closed.
- // Does nothing if |widget| is null.
- static void CloseSecondaryWidget(Widget* widget);
-
// Initializes the window. Must be called before any post-configuration
// operations are performed.
void InitWindow(const InitParams& params);
@@ -124,7 +115,7 @@ class Window : public internal::NativeWindowDelegate {
// Closes the window, ultimately destroying it. The window hides immediately,
// and is destroyed after a return to the message loop. Close() can be called
// multiple times.
- void CloseWindow();
+ virtual void Close() OVERRIDE;
// Maximizes/minimizes/restores the window.
void Maximize();
@@ -138,7 +129,7 @@ class Window : public internal::NativeWindowDelegate {
bool IsVisible() const;
// Whether or not the window is maximized or minimized.
- bool IsMaximized() const;
+ virtual bool IsMaximized() const;
bool IsMinimized() const;
// Accessors for fullscreen state.
@@ -149,11 +140,6 @@ class Window : public internal::NativeWindowDelegate {
// frame" - slightly transparent and without the standard window controls.
void SetUseDragFrame(bool use_drag_frame);
- // Returns true if the Window is considered to be an "app window" - i.e.
- // any window which when it is the last of its type closed causes the
- // application to exit.
- virtual bool IsAppWindow() const;
-
// Toggles the enable state for the Close button (and the Close menu item in
// the system menu).
void EnableClose(bool enable);
@@ -182,10 +168,6 @@ class Window : public internal::NativeWindowDelegate {
// Tell the window that something caused the frame type to change.
void FrameTypeChanged();
- // TODO(beng): remove once Window subclasses Widget.
- Widget* AsWidget();
- const Widget* AsWidget() const;
-
WindowDelegate* window_delegate() {
return const_cast<WindowDelegate*>(
const_cast<const Window*>(this)->window_delegate());
@@ -213,10 +195,6 @@ class Window : public internal::NativeWindowDelegate {
NativeWindow* native_window() { return native_window_; }
protected:
- // TODO(beng): Temporarily provided as a way to associate the subclass'
- // implementation of NativeWidget with this.
- void SetNativeWindow(NativeWindow* native_window);
-
// Overridden from NativeWindowDelegate:
virtual bool CanActivate() const OVERRIDE;
virtual bool IsInactiveRenderingDisabled() const OVERRIDE;
@@ -234,6 +212,8 @@ class Window : public internal::NativeWindowDelegate {
virtual void OnNativeWindowDestroying() OVERRIDE;
virtual void OnNativeWindowDestroyed() OVERRIDE;
virtual void OnNativeWindowBoundsChanged() OVERRIDE;
+ virtual Window* AsWindow() OVERRIDE;
+ virtual internal::NativeWidgetDelegate* AsNativeWidgetDelegate() OVERRIDE;
private:
// Sizes and positions the window just after it is created.