diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-22 03:47:31 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-22 03:47:31 +0000 |
commit | 66d22164c2aded1403643b52a9763f492acbbdcc (patch) | |
tree | 17f103ef313956ce3d6039663701fb52358df6cc /ui | |
parent | b233717168b03e58e2110897e96686ce7ea501f4 (diff) | |
download | chromium_src-66d22164c2aded1403643b52a9763f492acbbdcc.zip chromium_src-66d22164c2aded1403643b52a9763f492acbbdcc.tar.gz chromium_src-66d22164c2aded1403643b52a9763f492acbbdcc.tar.bz2 |
Get rid of the EnableClose() infrastructure in Widget.
Only one place was left using it (FirstRunSearchEngineView), and Brian said that didn't need to use it if it would just pick the first of the engine choices (prior to randomization) as the window was closed.
http://crbug.com/102581
TEST=unittests, and: run organic first run chrome, close the search engine selector, the Google should be the default. run organic first run Chrome, choose a non-Google engine, it should be the default.
Review URL: http://codereview.chromium.org/8618001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/aura_shell/toplevel_frame_view.cc | 9 | ||||
-rw-r--r-- | ui/aura_shell/toplevel_frame_view.h | 1 | ||||
-rw-r--r-- | ui/views/bubble/bubble_frame_view.h | 1 | ||||
-rw-r--r-- | ui/views/widget/native_widget_aura.cc | 5 | ||||
-rw-r--r-- | ui/views/widget/native_widget_aura.h | 1 | ||||
-rw-r--r-- | ui/views/widget/native_widget_gtk.cc | 4 | ||||
-rw-r--r-- | ui/views/widget/native_widget_gtk.h | 1 | ||||
-rw-r--r-- | ui/views/widget/native_widget_private.h | 1 | ||||
-rw-r--r-- | ui/views/widget/native_widget_win.cc | 7 | ||||
-rw-r--r-- | ui/views/widget/native_widget_win.h | 1 | ||||
-rw-r--r-- | ui/views/widget/widget.cc | 6 | ||||
-rw-r--r-- | ui/views/widget/widget.h | 4 | ||||
-rw-r--r-- | ui/views/window/custom_frame_view.cc | 4 | ||||
-rw-r--r-- | ui/views/window/custom_frame_view.h | 1 | ||||
-rw-r--r-- | ui/views/window/native_frame_view.cc | 4 | ||||
-rw-r--r-- | ui/views/window/native_frame_view.h | 1 | ||||
-rw-r--r-- | ui/views/window/non_client_view.cc | 4 | ||||
-rw-r--r-- | ui/views/window/non_client_view.h | 5 |
18 files changed, 0 insertions, 60 deletions
diff --git a/ui/aura_shell/toplevel_frame_view.cc b/ui/aura_shell/toplevel_frame_view.cc index ab891a6..b1c06da 100644 --- a/ui/aura_shell/toplevel_frame_view.cc +++ b/ui/aura_shell/toplevel_frame_view.cc @@ -161,11 +161,6 @@ class WindowCaption : public FrameComponent, return HTNOWHERE; } - // Updates the enabled state of the close button. - void EnableClose(bool enable) { - close_button_->SetEnabled(enable); - } - // Overridden from FrameComponent: virtual bool IgnoreEventsForPoint(const gfx::Point& point) OVERRIDE { gfx::Point translated_point(point); @@ -401,10 +396,6 @@ void ToplevelFrameView::GetWindowMask(const gfx::Size& size, // Nothing. } -void ToplevelFrameView::EnableClose(bool enable) { - caption_->EnableClose(enable); -} - void ToplevelFrameView::ResetWindowControls() { NOTIMPLEMENTED(); } diff --git a/ui/aura_shell/toplevel_frame_view.h b/ui/aura_shell/toplevel_frame_view.h index cae7d8f..69af2be 100644 --- a/ui/aura_shell/toplevel_frame_view.h +++ b/ui/aura_shell/toplevel_frame_view.h @@ -56,7 +56,6 @@ class AURA_SHELL_EXPORT ToplevelFrameView : public views::NonClientFrameView { virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) OVERRIDE; - virtual void EnableClose(bool enable) OVERRIDE; virtual void ResetWindowControls() OVERRIDE; virtual void UpdateWindowIcon() OVERRIDE; diff --git a/ui/views/bubble/bubble_frame_view.h b/ui/views/bubble/bubble_frame_view.h index e3aca58..47861eb 100644 --- a/ui/views/bubble/bubble_frame_view.h +++ b/ui/views/bubble/bubble_frame_view.h @@ -32,7 +32,6 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView { virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) OVERRIDE {} - virtual void EnableClose(bool enable) OVERRIDE {} virtual void ResetWindowControls() OVERRIDE {} virtual void UpdateWindowIcon() OVERRIDE {} diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc index a0f87e2..87a1573 100644 --- a/ui/views/widget/native_widget_aura.cc +++ b/ui/views/widget/native_widget_aura.cc @@ -390,11 +390,6 @@ void NativeWidgetAura::CloseNow() { delete window_; } -void NativeWidgetAura::EnableClose(bool enable) { - // http://crbug.com/102581 - NOTIMPLEMENTED(); -} - void NativeWidgetAura::Show() { ShowWithWindowState(ui::SHOW_STATE_INACTIVE); } diff --git a/ui/views/widget/native_widget_aura.h b/ui/views/widget/native_widget_aura.h index 90d0562..f5abd78 100644 --- a/ui/views/widget/native_widget_aura.h +++ b/ui/views/widget/native_widget_aura.h @@ -87,7 +87,6 @@ class VIEWS_EXPORT NativeWidgetAura : public internal::NativeWidgetPrivate, virtual void SetShape(gfx::NativeRegion shape) OVERRIDE; virtual void Close() OVERRIDE; virtual void CloseNow() OVERRIDE; - virtual void EnableClose(bool enable) OVERRIDE; virtual void Show() OVERRIDE; virtual void Hide() OVERRIDE; virtual void ShowMaximizedWithBounds( diff --git a/ui/views/widget/native_widget_gtk.cc b/ui/views/widget/native_widget_gtk.cc index a8ed357..4bf288a 100644 --- a/ui/views/widget/native_widget_gtk.cc +++ b/ui/views/widget/native_widget_gtk.cc @@ -1180,10 +1180,6 @@ void NativeWidgetGtk::CloseNow() { } } -void NativeWidgetGtk::EnableClose(bool enable) { - gtk_window_set_deletable(GetNativeWindow(), enable); -} - void NativeWidgetGtk::Show() { if (widget_) { gtk_widget_show(widget_); diff --git a/ui/views/widget/native_widget_gtk.h b/ui/views/widget/native_widget_gtk.h index 4427aa8..51184ee 100644 --- a/ui/views/widget/native_widget_gtk.h +++ b/ui/views/widget/native_widget_gtk.h @@ -190,7 +190,6 @@ class VIEWS_EXPORT NativeWidgetGtk : public internal::NativeWidgetPrivate, virtual void SetShape(gfx::NativeRegion shape) OVERRIDE; virtual void Close() OVERRIDE; virtual void CloseNow() OVERRIDE; - virtual void EnableClose(bool enable) OVERRIDE; virtual void Show() OVERRIDE; virtual void Hide() OVERRIDE; virtual void ShowMaximizedWithBounds( diff --git a/ui/views/widget/native_widget_private.h b/ui/views/widget/native_widget_private.h index 229a530..3f1b474 100644 --- a/ui/views/widget/native_widget_private.h +++ b/ui/views/widget/native_widget_private.h @@ -172,7 +172,6 @@ class VIEWS_EXPORT NativeWidgetPrivate : public NativeWidget, virtual void SetShape(gfx::NativeRegion shape) = 0; virtual void Close() = 0; virtual void CloseNow() = 0; - virtual void EnableClose(bool enable) = 0; virtual void Show() = 0; virtual void Hide() = 0; // Invoked if the initial show should maximize the window. |restored_bounds| diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc index 73dc917..a8022c8 100644 --- a/ui/views/widget/native_widget_win.cc +++ b/ui/views/widget/native_widget_win.cc @@ -756,13 +756,6 @@ void NativeWidgetWin::CloseNow() { DestroyWindow(hwnd()); } -void NativeWidgetWin::EnableClose(bool enable) { - // Disable the native frame's close button regardless of whether or not the - // native frame is in use, since this also affects the system menu. - EnableMenuItem(GetSystemMenu(GetNativeView(), false), SC_CLOSE, enable); - SendFrameChanged(GetNativeView()); -} - void NativeWidgetWin::Show() { if (!IsWindow()) return; diff --git a/ui/views/widget/native_widget_win.h b/ui/views/widget/native_widget_win.h index df9a3fc..9618811 100644 --- a/ui/views/widget/native_widget_win.h +++ b/ui/views/widget/native_widget_win.h @@ -225,7 +225,6 @@ class VIEWS_EXPORT NativeWidgetWin : public ui::WindowImpl, virtual void SetShape(gfx::NativeRegion shape) OVERRIDE; virtual void Close() OVERRIDE; virtual void CloseNow() OVERRIDE; - virtual void EnableClose(bool enable) OVERRIDE; virtual void Show() OVERRIDE; virtual void Hide() OVERRIDE; virtual void ShowMaximizedWithBounds( diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc index 857dac5..53c1577 100644 --- a/ui/views/widget/widget.cc +++ b/ui/views/widget/widget.cc @@ -489,12 +489,6 @@ void Widget::CloseNow() { native_widget_->CloseNow(); } -void Widget::EnableClose(bool enable) { - if (non_client_view_) - non_client_view_->EnableClose(enable); - native_widget_->EnableClose(enable); -} - void Widget::Show() { if (non_client_view_) { if (saved_show_state_ == ui::SHOW_STATE_MAXIMIZED && diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h index 4beda65..ad0a7bf 100644 --- a/ui/views/widget/widget.h +++ b/ui/views/widget/widget.h @@ -321,10 +321,6 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // any code that expects it to be valid beyond this call. void CloseNow(); - // Toggles the enable state for the Close button (and the Close menu item in - // the system menu). - void EnableClose(bool enable); - // Shows or hides the widget, without changing activation state. virtual void Show(); void Hide(); diff --git a/ui/views/window/custom_frame_view.cc b/ui/views/window/custom_frame_view.cc index 9019919..fae0d2f 100644 --- a/ui/views/window/custom_frame_view.cc +++ b/ui/views/window/custom_frame_view.cc @@ -192,10 +192,6 @@ void CustomFrameView::GetWindowMask(const gfx::Size& size, views::GetDefaultWindowMask(size, window_mask); } -void CustomFrameView::EnableClose(bool enable) { - close_button_->SetEnabled(enable); -} - void CustomFrameView::ResetWindowControls() { restore_button_->SetState(CustomButton::BS_NORMAL); minimize_button_->SetState(CustomButton::BS_NORMAL); diff --git a/ui/views/window/custom_frame_view.h b/ui/views/window/custom_frame_view.h index 2d2d3d4..111be34 100644 --- a/ui/views/window/custom_frame_view.h +++ b/ui/views/window/custom_frame_view.h @@ -41,7 +41,6 @@ class CustomFrameView : public NonClientFrameView, virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) OVERRIDE; - virtual void EnableClose(bool enable) OVERRIDE; virtual void ResetWindowControls() OVERRIDE; virtual void UpdateWindowIcon() OVERRIDE; diff --git a/ui/views/window/native_frame_view.cc b/ui/views/window/native_frame_view.cc index 1605e3d..c9e8ed2 100644 --- a/ui/views/window/native_frame_view.cc +++ b/ui/views/window/native_frame_view.cc @@ -55,10 +55,6 @@ void NativeFrameView::GetWindowMask(const gfx::Size& size, // Nothing to do, we use the default window mask. } -void NativeFrameView::EnableClose(bool enable) { - // Nothing to do, handled automatically by Window. -} - void NativeFrameView::ResetWindowControls() { // Nothing to do. } diff --git a/ui/views/window/native_frame_view.h b/ui/views/window/native_frame_view.h index edcf993..78d3d77 100644 --- a/ui/views/window/native_frame_view.h +++ b/ui/views/window/native_frame_view.h @@ -24,7 +24,6 @@ class VIEWS_EXPORT NativeFrameView : public NonClientFrameView { virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) OVERRIDE; - virtual void EnableClose(bool enable) OVERRIDE; virtual void ResetWindowControls() OVERRIDE; virtual void UpdateWindowIcon() OVERRIDE; diff --git a/ui/views/window/non_client_view.cc b/ui/views/window/non_client_view.cc index 702042a..c880414 100644 --- a/ui/views/window/non_client_view.cc +++ b/ui/views/window/non_client_view.cc @@ -87,10 +87,6 @@ void NonClientView::GetWindowMask(const gfx::Size& size, frame_view_->GetWindowMask(size, window_mask); } -void NonClientView::EnableClose(bool enable) { - frame_view_->EnableClose(enable); -} - void NonClientView::ResetWindowControls() { frame_view_->ResetWindowControls(); } diff --git a/ui/views/window/non_client_view.h b/ui/views/window/non_client_view.h index 9685d95..fc97d69 100644 --- a/ui/views/window/non_client_view.h +++ b/ui/views/window/non_client_view.h @@ -53,7 +53,6 @@ class VIEWS_EXPORT NonClientFrameView : public View { virtual int NonClientHitTest(const gfx::Point& point) = 0; virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) = 0; - virtual void EnableClose(bool enable) = 0; virtual void ResetWindowControls() = 0; virtual void UpdateWindowIcon() = 0; @@ -175,10 +174,6 @@ class VIEWS_EXPORT NonClientView : public View { // size. This is used to create the non-rectangular window shape. void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); - // Toggles the enable state for the Close button (and the Close menu item in - // the system menu). - void EnableClose(bool enable); - // Tells the window controls as rendered by the NonClientView to reset // themselves to a normal state. This happens in situations where the // containing window does not receive a normal sequences of messages that |