diff options
author | skuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-06 01:05:42 +0000 |
---|---|---|
committer | skuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-06 01:05:42 +0000 |
commit | 22235c78075b457f19a5031e0768da8b6e2f421b (patch) | |
tree | 65d1bd5b706316d3386a0505b2f2e08c7dd3965e | |
parent | ae873b850f38962f8de63e23b8750c0df6c34ca1 (diff) | |
download | chromium_src-22235c78075b457f19a5031e0768da8b6e2f421b.zip chromium_src-22235c78075b457f19a5031e0768da8b6e2f421b.tar.gz chromium_src-22235c78075b457f19a5031e0768da8b6e2f421b.tar.bz2 |
Don't save the touch view mode window state in the session restore set
BUG=354637
TEST=unit test & visual test
Review URL: https://codereview.chromium.org/252383007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268353 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc | 79 | ||||
-rw-r--r-- | ash/wm/maximize_mode/maximize_mode_window_state.cc | 20 | ||||
-rw-r--r-- | ash/wm/window_properties.cc | 10 | ||||
-rw-r--r-- | ash/wm/window_properties.h | 13 | ||||
-rw-r--r-- | chrome/browser/ui/views/apps/chrome_native_app_window_views.cc | 48 | ||||
-rw-r--r-- | chrome/browser/ui/views/apps/chrome_native_app_window_views.h | 1 | ||||
-rw-r--r-- | chrome/browser/ui/views/frame/browser_frame.cc | 9 | ||||
-rw-r--r-- | chrome/browser/ui/views/frame/browser_frame.h | 7 | ||||
-rw-r--r-- | chrome/browser/ui/views/frame/browser_frame_ash.cc | 22 | ||||
-rw-r--r-- | chrome/browser/ui/views/frame/browser_frame_ash.h | 5 | ||||
-rw-r--r-- | chrome/browser/ui/views/frame/browser_view.cc | 25 | ||||
-rw-r--r-- | chrome/browser/ui/views/frame/desktop_browser_frame_aura.cc | 17 | ||||
-rw-r--r-- | chrome/browser/ui/views/frame/desktop_browser_frame_aura.h | 4 | ||||
-rw-r--r-- | chrome/browser/ui/views/frame/native_browser_frame.h | 10 |
14 files changed, 241 insertions, 29 deletions
diff --git a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc index 56c6c53..b95aef6 100644 --- a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc +++ b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc @@ -13,8 +13,10 @@ #include "ash/test/shell_test_api.h" #include "ash/wm/mru_window_tracker.h" #include "ash/wm/overview/window_selector_controller.h" +#include "ash/wm/window_properties.h" #include "ash/wm/window_state.h" #include "ash/wm/wm_event.h" +#include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "ui/aura/client/aura_constants.h" @@ -58,6 +60,21 @@ class MaximizeModeWindowManagerTest : public test::AshTestBase { type, bounds, gfx::Size(), true, true); } + // Creates a window which also has a widget. + aura::Window* CreateWindowWithWidget(const gfx::Rect& bounds) { + views::Widget* widget = new views::Widget(); + views::Widget::InitParams params; + params.context = CurrentContext(); + // Note: The widget will get deleted with the window. + widget->Init(params); + widget->Show(); + aura::Window* window = widget->GetNativeWindow(); + window->SetBounds(bounds); + window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); + + return window; + } + // Create the Maximized mode window manager. ash::MaximizeModeWindowManager* CreateMaximizeModeWindowManager() { EXPECT_FALSE(maximize_mode_window_manager()); @@ -392,6 +409,68 @@ TEST_F(MaximizeModeWindowManagerTest, EXPECT_EQ(rect.ToString(), fixed_window->bounds().ToString()); } +// Create a string which consists of the bounds and the state for comparison. +std::string GetPlacementString(const gfx::Rect& bounds, + ui::WindowShowState state) { + return bounds.ToString() + base::StringPrintf(" %d", state); +} + +// Retrieves the window's restore state override - if any - and returns it as a +// string. +std::string GetPlacementOverride(aura::Window* window) { + gfx::Rect* bounds = window->GetProperty(ash::kRestoreBoundsOverrideKey); + if (bounds) { + gfx::Rect restore_bounds = *bounds; + ui::WindowShowState restore_state = + window->GetProperty(ash::kRestoreShowStateOverrideKey); + return GetPlacementString(restore_bounds, restore_state); + } + return std::string(); +} + +// Test that the restore state will be kept at its original value for +// session restauration purposes. +TEST_F(MaximizeModeWindowManagerTest, TestRestoreIntegrety) { + gfx::Rect bounds(10, 10, 200, 50); + gfx::Size empty_size; + gfx::Rect empty_bounds; + scoped_ptr<aura::Window> normal_window( + CreateWindowWithWidget(bounds)); + scoped_ptr<aura::Window> maximized_window( + CreateWindowWithWidget(bounds)); + wm::GetWindowState(maximized_window.get())->Maximize(); + + EXPECT_EQ(std::string(), GetPlacementOverride(normal_window.get())); + EXPECT_EQ(std::string(), GetPlacementOverride(maximized_window.get())); + + ash::MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); + ASSERT_TRUE(manager); + + // With the maximization the override states should be returned in its + // pre-maximized state. + EXPECT_EQ(GetPlacementString(bounds, ui::SHOW_STATE_NORMAL), + GetPlacementOverride(normal_window.get())); + EXPECT_EQ(GetPlacementString(bounds, ui::SHOW_STATE_MAXIMIZED), + GetPlacementOverride(maximized_window.get())); + + // Changing a window's state now does not change the returned result. + wm::GetWindowState(maximized_window.get())->Minimize(); + EXPECT_EQ(GetPlacementString(bounds, ui::SHOW_STATE_MAXIMIZED), + GetPlacementOverride(maximized_window.get())); + + // Destroy the manager again and check that the overrides get reset. + DestroyMaximizeModeWindowManager(); + EXPECT_EQ(std::string(), GetPlacementOverride(normal_window.get())); + EXPECT_EQ(std::string(), GetPlacementOverride(maximized_window.get())); + + // Changing a window's state now does not bring the overrides back. + wm::GetWindowState(maximized_window.get())->Restore(); + gfx::Rect new_bounds(10, 10, 200, 50); + maximized_window->SetBounds(new_bounds); + + EXPECT_EQ(std::string(), GetPlacementOverride(maximized_window.get())); +} + // Test that windows which got created before the maximizer was created can be // destroyed while the maximizer is still running. TEST_F(MaximizeModeWindowManagerTest, PreCreateWindowsDeleteWhileActive) { diff --git a/ash/wm/maximize_mode/maximize_mode_window_state.cc b/ash/wm/maximize_mode/maximize_mode_window_state.cc index df98796..be60450 100644 --- a/ash/wm/maximize_mode/maximize_mode_window_state.cc +++ b/ash/wm/maximize_mode/maximize_mode_window_state.cc @@ -11,7 +11,7 @@ #include "ash/wm/coordinate_conversion.h" #include "ash/wm/maximize_mode/maximize_mode_window_manager.h" #include "ash/wm/window_animations.h" -#include "ash/wm/window_state.h" +#include "ash/wm/window_properties.h" #include "ash/wm/window_state_delegate.h" #include "ash/wm/window_state_util.h" #include "ash/wm/window_util.h" @@ -22,6 +22,8 @@ #include "ui/aura/window_delegate.h" #include "ui/gfx/display.h" #include "ui/gfx/rect.h" +#include "ui/views/view_constants_aura.h" +#include "ui/views/widget/widget.h" namespace ash { namespace { @@ -186,6 +188,20 @@ void MaximizeModeWindowState::AttachState( wm::WindowState::State* previous_state) { current_state_type_ = previous_state->GetType(); + views::Widget* widget = + views::Widget::GetWidgetForNativeWindow(window_state->window()); + if (widget) { + gfx::Rect bounds = widget->GetRestoredBounds(); + if (!bounds.IsEmpty()) { + // We do not want to do a session restore to our window states. Therefore + // we tell the window to use the current default states instead. + window_state->window()->SetProperty(ash::kRestoreShowStateOverrideKey, + window_state->GetShowState()); + window_state->window()->SetProperty(ash::kRestoreBoundsOverrideKey, + new gfx::Rect(widget->GetRestoredBounds())); + } + } + // Initialize the state to a good preset. if (current_state_type_ != wm::WINDOW_STATE_TYPE_MAXIMIZED && current_state_type_ != wm::WINDOW_STATE_TYPE_MINIMIZED && @@ -199,6 +215,8 @@ void MaximizeModeWindowState::AttachState( } void MaximizeModeWindowState::DetachState(wm::WindowState* window_state) { + // From now on, we can use the default session restore mechanism again. + window_state->window()->ClearProperty(ash::kRestoreBoundsOverrideKey); window_state->set_can_be_dragged(true); } diff --git a/ash/wm/window_properties.cc b/ash/wm/window_properties.cc index 1689c90..2657e3a 100644 --- a/ash/wm/window_properties.cc +++ b/ash/wm/window_properties.cc @@ -8,9 +8,19 @@ #include "ui/aura/window_property.h" DECLARE_WINDOW_PROPERTY_TYPE(ash::wm::WindowState*); +DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(ASH_EXPORT, gfx::Rect*) +DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(ASH_EXPORT, ui::WindowShowState) namespace ash { +DEFINE_OWNED_WINDOW_PROPERTY_KEY(gfx::Rect, + kRestoreBoundsOverrideKey, + NULL); + +DEFINE_WINDOW_PROPERTY_KEY(ui::WindowShowState, + kRestoreShowStateOverrideKey, + ui::SHOW_STATE_DEFAULT); + DEFINE_WINDOW_PROPERTY_KEY(bool, kStayInSameRootWindowKey, false); DEFINE_WINDOW_PROPERTY_KEY(bool, kUsesScreenCoordinatesKey, false); DEFINE_OWNED_WINDOW_PROPERTY_KEY(wm::WindowState, diff --git a/ash/wm/window_properties.h b/ash/wm/window_properties.h index c99d21d..c79b694 100644 --- a/ash/wm/window_properties.h +++ b/ash/wm/window_properties.h @@ -7,6 +7,7 @@ #include "ash/ash_export.h" #include "ui/base/ui_base_types.h" +#include "ui/gfx/rect.h" namespace aura { class Window; @@ -24,6 +25,18 @@ class WindowState; // Alphabetical sort. +// A property key which stores the bounds to restore a window to. These take +// preference over the current bounds/state. This is used by e.g. the always +// maximized mode window manager. +ASH_EXPORT extern const aura::WindowProperty<gfx::Rect*>* const + kRestoreBoundsOverrideKey; + +// A property key which stores the bounds to restore a window to. These take +// preference over the current bounds/state if |kRestoreBoundsOverrideKey| is +// set. This is used by e.g. the always maximized mode window manager. +ASH_EXPORT extern const aura::WindowProperty<ui::WindowShowState>* const + kRestoreShowStateOverrideKey; + // If this is set to true, the window stays in the same root window // even if the bounds outside of its root window is set. // This is exported as it's used in the tests. diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc index 189ed9e..1be2fd9 100644 --- a/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc +++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc @@ -40,6 +40,7 @@ #include "ash/shell.h" #include "ash/wm/immersive_fullscreen_controller.h" #include "ash/wm/panels/panel_frame_view.h" +#include "ash/wm/window_properties.h" #include "ash/wm/window_state.h" #include "ash/wm/window_state_delegate.h" #include "ash/wm/window_state_observer.h" @@ -387,25 +388,46 @@ ChromeNativeAppWindowViews::CreateNonStandardAppFrame() { // ui::BaseWindow implementation. +gfx::Rect ChromeNativeAppWindowViews::GetRestoredBounds() const { +#if defined(USE_ASH) + gfx::Rect* bounds = widget()->GetNativeWindow()->GetProperty( + ash::kRestoreBoundsOverrideKey); + if (bounds && !bounds->IsEmpty()) + return *bounds; +#endif + return widget()->GetRestoredBounds(); +} + ui::WindowShowState ChromeNativeAppWindowViews::GetRestoredState() const { +#if !defined(USE_ASH) if (IsMaximized()) return ui::SHOW_STATE_MAXIMIZED; - if (IsFullscreen()) { -#if defined(USE_ASH) - if (immersive_fullscreen_controller_.get() && - immersive_fullscreen_controller_->IsEnabled()) { - // Restore windows which were previously in immersive fullscreen to - // maximized. Restoring the window to a different fullscreen type - // makes for a bad experience. - return ui::SHOW_STATE_MAXIMIZED; - } -#endif + if (IsFullscreen()) return ui::SHOW_STATE_FULLSCREEN; - } -#if defined(USE_ASH) +#else // Use kRestoreShowStateKey in case a window is minimized/hidden. ui::WindowShowState restore_state = widget()->GetNativeWindow()->GetProperty( aura::client::kRestoreShowStateKey); + if (widget()->GetNativeWindow()->GetProperty( + ash::kRestoreBoundsOverrideKey)) { + // If an override is given, we use that restore state (after filtering). + restore_state = widget()->GetNativeWindow()->GetProperty( + ash::kRestoreShowStateOverrideKey); + } else { + // Otherwise first normal states are checked. + if (IsMaximized()) + return ui::SHOW_STATE_MAXIMIZED; + if (IsFullscreen()) { + if (immersive_fullscreen_controller_.get() && + immersive_fullscreen_controller_->IsEnabled()) { + // Restore windows which were previously in immersive fullscreen to + // maximized. Restoring the window to a different fullscreen type + // makes for a bad experience. + return ui::SHOW_STATE_MAXIMIZED; + } + return ui::SHOW_STATE_FULLSCREEN; + } + } // Whitelist states to return so that invalid and transient states // are not saved and used to restore windows when they are recreated. switch (restore_state) { @@ -421,7 +443,7 @@ ui::WindowShowState ChromeNativeAppWindowViews::GetRestoredState() const { case ui::SHOW_STATE_END: return ui::SHOW_STATE_NORMAL; } -#endif +#endif // !defined(USE_ASH) return ui::SHOW_STATE_NORMAL; } diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views.h b/chrome/browser/ui/views/apps/chrome_native_app_window_views.h index ec2b160..e5a65f4 100644 --- a/chrome/browser/ui/views/apps/chrome_native_app_window_views.h +++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views.h @@ -48,6 +48,7 @@ class ChromeNativeAppWindowViews : public apps::NativeAppWindowViews, apps::AppWindowFrameView* CreateNonStandardAppFrame(); // ui::BaseWindow implementation. + virtual gfx::Rect GetRestoredBounds() const OVERRIDE; virtual ui::WindowShowState GetRestoredState() const OVERRIDE; virtual bool IsAlwaysOnTop() const OVERRIDE; diff --git a/chrome/browser/ui/views/frame/browser_frame.cc b/chrome/browser/ui/views/frame/browser_frame.cc index ca38b78..627effc 100644 --- a/chrome/browser/ui/views/frame/browser_frame.cc +++ b/chrome/browser/ui/views/frame/browser_frame.cc @@ -191,6 +191,15 @@ bool BrowserFrame::UseCustomFrame() const { return use_custom_frame_pref_.GetValue(); } +bool BrowserFrame::ShouldSaveWindowPlacement() const { + return native_browser_frame_->ShouldSaveWindowPlacement(); +} + +void BrowserFrame::GetWindowPlacement(gfx::Rect* bounds, + ui::WindowShowState* show_state) const { + return native_browser_frame_->GetWindowPlacement(bounds, show_state); +} + /////////////////////////////////////////////////////////////////////////////// // BrowserFrame, views::Widget overrides: diff --git a/chrome/browser/ui/views/frame/browser_frame.h b/chrome/browser/ui/views/frame/browser_frame.h index 87bdea0..3fa17e7 100644 --- a/chrome/browser/ui/views/frame/browser_frame.h +++ b/chrome/browser/ui/views/frame/browser_frame.h @@ -79,6 +79,13 @@ class BrowserFrame // Returns |true| if we should use the custom frame. bool UseCustomFrame() const; + // Returns true when the window placement should be saved. + bool ShouldSaveWindowPlacement() const; + + // Retrieves the window placement (show state and bounds) for restoring. + void GetWindowPlacement(gfx::Rect* bounds, + ui::WindowShowState* show_state) const; + // Overridden from views::Widget: virtual views::internal::RootView* CreateRootView() OVERRIDE; virtual views::NonClientFrameView* CreateNonClientFrameView() OVERRIDE; diff --git a/chrome/browser/ui/views/frame/browser_frame_ash.cc b/chrome/browser/ui/views/frame/browser_frame_ash.cc index 5cd1ac0..4561efc 100644 --- a/chrome/browser/ui/views/frame/browser_frame_ash.cc +++ b/chrome/browser/ui/views/frame/browser_frame_ash.cc @@ -4,6 +4,7 @@ #include "chrome/browser/ui/views/frame/browser_frame_ash.h" +#include "ash/wm/window_properties.h" #include "ash/wm/window_state.h" #include "ash/wm/window_state_delegate.h" #include "ash/wm/window_util.h" @@ -97,6 +98,27 @@ void BrowserFrameAsh::OnWindowTargetVisibilityChanged(bool visible) { views::NativeWidgetAura::OnWindowTargetVisibilityChanged(visible); } +bool BrowserFrameAsh::ShouldSaveWindowPlacement() const { + return NULL != GetWidget()->GetNativeWindow()->GetProperty( + ash::kRestoreBoundsOverrideKey); +} + +void BrowserFrameAsh::GetWindowPlacement( + gfx::Rect* bounds, + ui::WindowShowState* show_state) const { + gfx::Rect* override_bounds = GetWidget()->GetNativeWindow()->GetProperty( + ash::kRestoreBoundsOverrideKey); + if (override_bounds && !override_bounds->IsEmpty()) { + *bounds = *override_bounds; + *show_state = GetWidget()->GetNativeWindow()->GetProperty( + ash::kRestoreShowStateOverrideKey); + } else { + *bounds = GetWidget()->GetRestoredBounds(); + *show_state = GetWidget()->GetNativeWindow()->GetProperty( + aura::client::kShowStateKey); + } +} + //////////////////////////////////////////////////////////////////////////////// // BrowserFrameAsh, NativeBrowserFrame implementation: diff --git a/chrome/browser/ui/views/frame/browser_frame_ash.h b/chrome/browser/ui/views/frame/browser_frame_ash.h index e55be39..f64ac7f 100644 --- a/chrome/browser/ui/views/frame/browser_frame_ash.h +++ b/chrome/browser/ui/views/frame/browser_frame_ash.h @@ -38,6 +38,11 @@ class BrowserFrameAsh : public views::NativeWidgetAura, virtual const views::NativeWidget* AsNativeWidget() const OVERRIDE; virtual bool UsesNativeSystemMenu() const OVERRIDE; virtual int GetMinimizeButtonOffset() const OVERRIDE; + virtual bool ShouldSaveWindowPlacement() const OVERRIDE; + virtual void GetWindowPlacement( + gfx::Rect* bounds, + ui::WindowShowState* show_state) const OVERRIDE; + virtual ~BrowserFrameAsh(); diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index af452fb..764eaa2 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -140,14 +140,6 @@ #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h" -#if defined(USE_ASH) -#include "ash/ash_switches.h" -#include "ash/shelf/shelf.h" -#include "ash/shelf/shelf_model.h" -#include "ash/shell.h" -#include "chrome/browser/ui/ash/ash_util.h" -#endif - #if defined(OS_WIN) #include "base/win/windows_version.h" #include "chrome/browser/jumplist_win.h" @@ -844,15 +836,17 @@ void BrowserView::ZoomChangedForActiveTab(bool can_show_bubble) { } gfx::Rect BrowserView::GetRestoredBounds() const { - return frame_->GetRestoredBounds(); + gfx::Rect bounds; + ui::WindowShowState state; + frame_->GetWindowPlacement(&bounds, &state); + return bounds; } ui::WindowShowState BrowserView::GetRestoredState() const { - if (IsMaximized()) - return ui::SHOW_STATE_MAXIMIZED; - if (IsMinimized()) - return ui::SHOW_STATE_MINIMIZED; - return ui::SHOW_STATE_NORMAL; + gfx::Rect bounds; + ui::WindowShowState state; + frame_->GetWindowPlacement(&bounds, &state); + return state; } gfx::Rect BrowserView::GetBounds() const { @@ -1608,7 +1602,8 @@ void BrowserView::SaveWindowPlacement(const gfx::Rect& bounds, // If IsFullscreen() is true, we've just changed into fullscreen mode, and // we're catching the going-into-fullscreen sizing and positioning calls, // which we want to ignore. - if (!IsFullscreen() && chrome::ShouldSaveWindowPlacement(browser_.get())) { + if (!IsFullscreen() && frame_->ShouldSaveWindowPlacement() && + chrome::ShouldSaveWindowPlacement(browser_.get())) { WidgetDelegate::SaveWindowPlacement(bounds, show_state); chrome::SaveWindowPlacement(browser_.get(), bounds, show_state); } diff --git a/chrome/browser/ui/views/frame/desktop_browser_frame_aura.cc b/chrome/browser/ui/views/frame/desktop_browser_frame_aura.cc index b114390..8ef74b6 100644 --- a/chrome/browser/ui/views/frame/desktop_browser_frame_aura.cc +++ b/chrome/browser/ui/views/frame/desktop_browser_frame_aura.cc @@ -92,3 +92,20 @@ bool DesktopBrowserFrameAura::UsesNativeSystemMenu() const { int DesktopBrowserFrameAura::GetMinimizeButtonOffset() const { return browser_desktop_window_tree_host_->GetMinimizeButtonOffset(); } + +bool DesktopBrowserFrameAura::ShouldSaveWindowPlacement() const { + // The placement can always be stored. + return true; +} + +void DesktopBrowserFrameAura::GetWindowPlacement( + gfx::Rect* bounds, + ui::WindowShowState* show_state) const { + *bounds = GetWidget()->GetRestoredBounds(); + if (IsMaximized()) + *show_state = ui::SHOW_STATE_MAXIMIZED; + else if (IsMinimized()) + *show_state = ui::SHOW_STATE_MINIMIZED; + else + *show_state = ui::SHOW_STATE_NORMAL; +} diff --git a/chrome/browser/ui/views/frame/desktop_browser_frame_aura.h b/chrome/browser/ui/views/frame/desktop_browser_frame_aura.h index 66f3da2..bba21fb 100644 --- a/chrome/browser/ui/views/frame/desktop_browser_frame_aura.h +++ b/chrome/browser/ui/views/frame/desktop_browser_frame_aura.h @@ -46,6 +46,10 @@ class DesktopBrowserFrameAura : public views::DesktopNativeWidgetAura, virtual const views::NativeWidget* AsNativeWidget() const OVERRIDE; virtual bool UsesNativeSystemMenu() const OVERRIDE; virtual int GetMinimizeButtonOffset() const OVERRIDE; + virtual bool ShouldSaveWindowPlacement() const OVERRIDE; + virtual void GetWindowPlacement( + gfx::Rect* bounds, + ui::WindowShowState* show_state) const OVERRIDE; private: // The BrowserView is our ClientView. This is a pointer to it. diff --git a/chrome/browser/ui/views/frame/native_browser_frame.h b/chrome/browser/ui/views/frame/native_browser_frame.h index 1aea739..846d9e7 100644 --- a/chrome/browser/ui/views/frame/native_browser_frame.h +++ b/chrome/browser/ui/views/frame/native_browser_frame.h @@ -5,6 +5,9 @@ #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_NATIVE_BROWSER_FRAME_H_ #define CHROME_BROWSER_UI_VIEWS_FRAME_NATIVE_BROWSER_FRAME_H_ +#include "ui/base/ui_base_types.h" +#include "ui/gfx/rect.h" + class BrowserFrame; class BrowserView; @@ -23,6 +26,13 @@ class NativeBrowserFrame { // false means BrowserFrame handles showing the system menu. virtual bool UsesNativeSystemMenu() const = 0; + // Returns true when the window placement should be stored. + virtual bool ShouldSaveWindowPlacement() const = 0; + + // Retrieves the window placement (show state and bounds) for restoring. + virtual void GetWindowPlacement(gfx::Rect* bounds, + ui::WindowShowState* show_state) const = 0; + protected: friend class BrowserFrame; |