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

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: add test 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..42f8c425d0c88c9d54fd6bb62903fec93f793a68 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,9 @@ class AppNonClientFrameViewAura::FrameObserver : public views::WidgetObserver {
DISALLOW_COPY_AND_ASSIGN(FrameObserver);
};
+const char AppNonClientFrameViewAura::kControlWindowName[] =
sky 2012/09/20 20:02:15 Typically we put: // static on the line before thi
James Cook 2012/09/20 20:06:54 Done.
+ "AppNonClientFrameViewAuraControls";
+
AppNonClientFrameViewAura::AppNonClientFrameViewAura(
BrowserFrame* frame, BrowserView* browser_view)
: BrowserNonClientFrameView(frame, browser_view),
@@ -182,7 +185,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 +193,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