Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1444)

Unified Diff: chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc

Issue 10961027: cros: Fix crash in AppNonClientFrameViewAura::ControlView::ButtonPressed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review feedback Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc
diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc b/chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc
index 0be6d628023e5012313567a63107e59e80c0e994..294fd2cec440f3a1a7e1b243bbd027e70a5399c8 100644
--- a/chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc
+++ b/chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc
@@ -162,6 +162,10 @@ class AppNonClientFrameViewAura::FrameObserver : public views::WidgetObserver {
DISALLOW_COPY_AND_ASSIGN(FrameObserver);
};
+// static
+const char AppNonClientFrameViewAura::kControlWindowName[] =
+ "AppNonClientFrameViewAuraControls";
+
AppNonClientFrameViewAura::AppNonClientFrameViewAura(
BrowserFrame* frame, BrowserView* browser_view)
: BrowserNonClientFrameView(frame, browser_view),
@@ -182,7 +186,7 @@ AppNonClientFrameViewAura::AppNonClientFrameViewAura(
control_widget_->Init(params);
control_widget_->SetContentsView(control_view_);
aura::Window* window = control_widget_->GetNativeView();
- window->SetName("AppNonClientFrameViewAuraControls");
+ window->SetName(kControlWindowName);
gfx::Rect control_bounds = GetControlBounds();
window->SetBounds(control_bounds);
control_widget_->Show();
@@ -190,6 +194,9 @@ AppNonClientFrameViewAura::AppNonClientFrameViewAura(
AppNonClientFrameViewAura::~AppNonClientFrameViewAura() {
frame()->RemoveObserver(frame_observer_.get());
+ // This frame view can be replaced (and deleted) if the window is restored
+ // via a keyboard shortcut like Alt-[. Ensure we close the control widget.
+ CloseControlWidget();
}
gfx::Rect AppNonClientFrameViewAura::GetBoundsForClientView() const {

Powered by Google App Engine
This is Rietveld 408576698