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

Side by Side Diff: ash/wm/app_list_controller.cc

Issue 10834079: views: Extract Widget observer into its own header file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
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/wm/app_list_controller.h" 5 #include "ash/wm/app_list_controller.h"
6 6
7 #include "ash/launcher/launcher.h" 7 #include "ash/launcher/launcher.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_delegate.h" 10 #include "ash/shell_delegate.h"
11 #include "ash/shell_window_ids.h" 11 #include "ash/shell_window_ids.h"
12 #include "ash/wm/property_util.h" 12 #include "ash/wm/property_util.h"
13 #include "ash/wm/shelf_layout_manager.h" 13 #include "ash/wm/shelf_layout_manager.h"
14 #include "ui/app_list/app_list_view.h" 14 #include "ui/app_list/app_list_view.h"
15 #include "ui/app_list/icon_cache.h" 15 #include "ui/app_list/icon_cache.h"
16 #include "ui/app_list/pagination_model.h" 16 #include "ui/app_list/pagination_model.h"
17 #include "ui/aura/event.h" 17 #include "ui/aura/event.h"
18 #include "ui/aura/focus_manager.h" 18 #include "ui/aura/focus_manager.h"
19 #include "ui/aura/root_window.h" 19 #include "ui/aura/root_window.h"
20 #include "ui/aura/window.h" 20 #include "ui/aura/window.h"
21 #include "ui/compositor/layer.h" 21 #include "ui/compositor/layer.h"
22 #include "ui/compositor/scoped_layer_animation_settings.h" 22 #include "ui/compositor/scoped_layer_animation_settings.h"
23 #include "ui/gfx/transform_util.h" 23 #include "ui/gfx/transform_util.h"
24 #include "ui/views/widget/widget.h"
24 25
25 namespace ash { 26 namespace ash {
26 namespace internal { 27 namespace internal {
27 28
28 namespace { 29 namespace {
29 30
30 // Duration for show/hide animation in milliseconds. 31 // Duration for show/hide animation in milliseconds.
31 const int kAnimationDurationMs = 200; 32 const int kAnimationDurationMs = 200;
32 33
33 // Offset in pixels to animation away/towards the launcher. 34 // Offset in pixels to animation away/towards the launcher.
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 // AppListController, ui::ImplicitAnimationObserver implementation: 282 // AppListController, ui::ImplicitAnimationObserver implementation:
282 283
283 void AppListController::OnImplicitAnimationsCompleted() { 284 void AppListController::OnImplicitAnimationsCompleted() {
284 if (is_visible_ ) 285 if (is_visible_ )
285 view_->GetWidget()->Activate(); 286 view_->GetWidget()->Activate();
286 else 287 else
287 view_->GetWidget()->Close(); 288 view_->GetWidget()->Close();
288 } 289 }
289 290
290 //////////////////////////////////////////////////////////////////////////////// 291 ////////////////////////////////////////////////////////////////////////////////
291 // AppListController, views::Widget::Observer implementation: 292 // AppListController, views::WidgetObserver implementation:
292 293
293 void AppListController::OnWidgetClosing(views::Widget* widget) { 294 void AppListController::OnWidgetClosing(views::Widget* widget) {
294 DCHECK(view_->GetWidget() == widget); 295 DCHECK(view_->GetWidget() == widget);
295 if (is_visible_) 296 if (is_visible_)
296 SetVisible(false); 297 SetVisible(false);
297 ResetView(); 298 ResetView();
298 } 299 }
299 300
300 //////////////////////////////////////////////////////////////////////////////// 301 ////////////////////////////////////////////////////////////////////////////////
301 // AppListController, ShellObserver implementation: 302 // AppListController, ShellObserver implementation:
302 void AppListController::OnShelfAlignmentChanged() { 303 void AppListController::OnShelfAlignmentChanged() {
303 if (view_) 304 if (view_)
304 view_->SetBubbleArrowLocation(GetBubbleArrowLocation()); 305 view_->SetBubbleArrowLocation(GetBubbleArrowLocation());
305 } 306 }
306 307
307 //////////////////////////////////////////////////////////////////////////////// 308 ////////////////////////////////////////////////////////////////////////////////
308 // AppListController, LauncherIconObserver implementation: 309 // AppListController, LauncherIconObserver implementation:
309 310
310 void AppListController::OnLauncherIconPositionsChanged() { 311 void AppListController::OnLauncherIconPositionsChanged() {
311 UpdateBounds(); 312 UpdateBounds();
312 } 313 }
313 314
314 } // namespace internal 315 } // namespace internal
315 } // namespace ash 316 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/app_list_controller.h ('k') | chrome/browser/chromeos/login/captive_portal_window_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698