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

Side by Side Diff: ash/app_list/app_list.cc

Issue 9331007: aura: Fix applist crash on 2nd show. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/app_list/app_list.h" 5 #include "ash/app_list/app_list.h"
6 6
7 #include "ash/app_list/app_list_model.h" 7 #include "ash/app_list/app_list_model.h"
8 #include "ash/app_list/app_list_view.h" 8 #include "ash/app_list/app_list_view.h"
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/shell_delegate.h" 10 #include "ash/shell_delegate.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 81
82 //////////////////////////////////////////////////////////////////////////////// 82 ////////////////////////////////////////////////////////////////////////////////
83 // AppList, private: 83 // AppList, private:
84 84
85 void AppList::SetWidget(views::Widget* widget) { 85 void AppList::SetWidget(views::Widget* widget) {
86 DCHECK(widget_ == NULL); 86 DCHECK(widget_ == NULL);
87 87
88 if (is_visible_) { 88 if (is_visible_) {
89 widget_ = widget; 89 widget_ = widget;
90 GetLayer(widget_)->GetAnimator()->AddObserver(this); 90 widget_->AddObserver(this);
91 Shell::GetInstance()->AddRootWindowEventFilter(this); 91 Shell::GetInstance()->AddRootWindowEventFilter(this);
92 92
93 widget_->SetBounds(GetPreferredBounds(false)); 93 widget_->SetBounds(GetPreferredBounds(false));
94 widget_->SetOpacity(0); 94 widget_->SetOpacity(0);
95 ScheduleAnimation(); 95 ScheduleAnimation();
96 96
97 widget_->Show(); 97 widget_->Show();
98 } else { 98 } else {
99 widget->Close(); 99 widget->Close();
100 } 100 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 182 }
183 183
184 void AppList::OnWidgetActivationChanged(views::Widget* widget, bool active) { 184 void AppList::OnWidgetActivationChanged(views::Widget* widget, bool active) {
185 DCHECK(widget_ == widget); 185 DCHECK(widget_ == widget);
186 if (widget_ && is_visible_ && !active) 186 if (widget_ && is_visible_ && !active)
187 SetVisible(false); 187 SetVisible(false);
188 } 188 }
189 189
190 } // namespace internal 190 } // namespace internal
191 } // namespace ash 191 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698