summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-19 14:51:36 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-19 14:51:36 +0000
commit6c8c80e7b1b85f30ad4c6626a9ec3f31818086da (patch)
treea066456b010b480d579b214ecffee48b3cb75057 /views
parent3c4beb226d1f279685d82861a062b599401cd2a9 (diff)
downloadchromium_src-6c8c80e7b1b85f30ad4c6626a9ec3f31818086da.zip
chromium_src-6c8c80e7b1b85f30ad4c6626a9ec3f31818086da.tar.gz
chromium_src-6c8c80e7b1b85f30ad4c6626a9ec3f31818086da.tar.bz2
Factor out a BrowserFrame interface, and move the existing Windows-based code
to a new class: BrowserFrameWin. The major other change I had to make was the way that the TabStrip is set in the BrowserRootView. Now there is a method on the frame that the view can call when it creats the tabstrip that will set the tabstrip on the root view. Review URL: http://codereview.chromium.org/113511 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16373 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/window/window.h14
-rw-r--r--views/window/window_gtk.cc12
-rw-r--r--views/window/window_gtk.h3
-rw-r--r--views/window/window_win.cc19
-rw-r--r--views/window/window_win.h11
5 files changed, 44 insertions, 15 deletions
diff --git a/views/window/window.h b/views/window/window.h
index 9d29a81..bb618ed 100644
--- a/views/window/window.h
+++ b/views/window/window.h
@@ -62,6 +62,20 @@ class Window {
// Makes the window visible.
virtual void Show() = 0;
+ // Hides the window. This does not delete the window, it just hides it. This
+ // always hides the window, it is separate from the stack maintained by
+ // Push/PopForceHidden.
+ virtual void HideWindow() = 0;
+
+ // Hides the window if it hasn't already been force-hidden. The force hidden
+ // count is tracked, so calling multiple times is allowed, you just have to
+ // be sure to call PopForceHidden the same number of times.
+ virtual void PushForceHidden() = 0;
+
+ // Decrements the force hidden count, showing the window if we have reached
+ // the top of the stack. See PushForceHidden.
+ virtual void PopForceHidden() = 0;
+
// Activate the window, assuming it already exists and is visible.
virtual void Activate() = 0;
diff --git a/views/window/window_gtk.cc b/views/window/window_gtk.cc
index b45f435..06558ae 100644
--- a/views/window/window_gtk.cc
+++ b/views/window/window_gtk.cc
@@ -55,6 +55,18 @@ void WindowGtk::Show() {
gtk_widget_show_all(GetNativeView());
}
+void WindowGtk::HideWindow() {
+ NOTIMPLEMENTED();
+}
+
+void WindowGtk::PushForceHidden() {
+ NOTIMPLEMENTED();
+}
+
+void WindowGtk::PopForceHidden() {
+ NOTIMPLEMENTED();
+}
+
void WindowGtk::Activate() {
NOTIMPLEMENTED();
}
diff --git a/views/window/window_gtk.h b/views/window/window_gtk.h
index f7a5366..4391c19 100644
--- a/views/window/window_gtk.h
+++ b/views/window/window_gtk.h
@@ -31,6 +31,9 @@ class WindowGtk : public WidgetGtk, public Window {
virtual void SetBounds(const gfx::Rect& bounds,
gfx::NativeWindow other_window);
virtual void Show();
+ virtual void HideWindow();
+ virtual void PushForceHidden();
+ virtual void PopForceHidden();
virtual void Activate();
virtual void Close();
virtual void Maximize();
diff --git a/views/window/window_win.cc b/views/window/window_win.cc
index 78fa32e..2286762 100644
--- a/views/window/window_win.cc
+++ b/views/window/window_win.cc
@@ -161,13 +161,9 @@ void WindowWin::Show(int show_state) {
SetInitialFocus();
}
-int WindowWin::GetShowState() const {
- return SW_SHOWNORMAL;
-}
-
-void WindowWin::ExecuteSystemMenuCommand(int command) {
- if (command)
- SendMessage(GetNativeView(), WM_SYSCOMMAND, command, 0);
+void WindowWin::HideWindow() {
+ // We can just call the function implemented by the widget.
+ Hide();
}
void WindowWin::PushForceHidden() {
@@ -182,6 +178,15 @@ void WindowWin::PopForceHidden() {
}
}
+int WindowWin::GetShowState() const {
+ return SW_SHOWNORMAL;
+}
+
+void WindowWin::ExecuteSystemMenuCommand(int command) {
+ if (command)
+ SendMessage(GetNativeView(), WM_SYSCOMMAND, command, 0);
+}
+
// static
int Window::GetLocalizedContentsWidth(int col_resource_id) {
double chars = _wtof(l10n_util::GetString(col_resource_id).c_str());
diff --git a/views/window/window_win.h b/views/window/window_win.h
index 1760caa..ddc2f21 100644
--- a/views/window/window_win.h
+++ b/views/window/window_win.h
@@ -44,14 +44,6 @@ class WindowWin : public WidgetWin,
// Executes the specified SC_command.
void ExecuteSystemMenuCommand(int command);
- // Hides the window if it hasn't already been force-hidden, then increments
- // |force_hidden_count_| to prevent it from being shown again until
- // PopForceHidden()) is called.
- void PushForceHidden();
-
- // Decrements |force_hidden_count_| and, if it is now zero, shows the window.
- void PopForceHidden();
-
// Accessors and setters for various properties.
HWND owning_window() const { return owning_hwnd_; }
void set_focus_on_creation(bool focus_on_creation) {
@@ -65,6 +57,9 @@ class WindowWin : public WidgetWin,
virtual void SetBounds(const gfx::Rect& bounds,
gfx::NativeWindow other_window);
virtual void Show();
+ virtual void HideWindow();
+ virtual void PushForceHidden();
+ virtual void PopForceHidden();
virtual void Activate();
virtual void Close();
virtual void Maximize();