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

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

Issue 1743493002: Cleanup ash shelf accessor functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert ash/shelf/shelf_widget.cc for browser_tests crash... Created 4 years, 9 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
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/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/screen_util.h" 9 #include "ash/screen_util.h"
10 #include "ash/shelf/shelf.h" 10 #include "ash/shelf/shelf.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // The minimal margin (in pixels) around the app list when in centered mode. 48 // The minimal margin (in pixels) around the app list when in centered mode.
49 const int kMinimalCenteredAppListMargin = 10; 49 const int kMinimalCenteredAppListMargin = 10;
50 50
51 ui::Layer* GetLayer(views::Widget* widget) { 51 ui::Layer* GetLayer(views::Widget* widget) {
52 return widget->GetNativeView()->layer(); 52 return widget->GetNativeView()->layer();
53 } 53 }
54 54
55 // Gets arrow location based on shelf alignment. 55 // Gets arrow location based on shelf alignment.
56 views::BubbleBorder::Arrow GetBubbleArrow(aura::Window* window) { 56 views::BubbleBorder::Arrow GetBubbleArrow(aura::Window* window) {
57 DCHECK(Shell::HasInstance()); 57 DCHECK(Shell::HasInstance());
58 return ShelfLayoutManager::ForShelf(window)-> 58 return Shelf::ForWindow(window)->SelectValueForShelfAlignment(
59 SelectValueForShelfAlignment( 59 views::BubbleBorder::BOTTOM_CENTER, views::BubbleBorder::LEFT_CENTER,
60 views::BubbleBorder::BOTTOM_CENTER, 60 views::BubbleBorder::RIGHT_CENTER, views::BubbleBorder::TOP_CENTER);
61 views::BubbleBorder::LEFT_CENTER,
62 views::BubbleBorder::RIGHT_CENTER,
63 views::BubbleBorder::TOP_CENTER);
64 } 61 }
65 62
66 // Offset given |rect| towards shelf. 63 // Offset given |rect| towards shelf.
67 gfx::Rect OffsetTowardsShelf(const gfx::Rect& rect, views::Widget* widget) { 64 gfx::Rect OffsetTowardsShelf(const gfx::Rect& rect, views::Widget* widget) {
68 DCHECK(Shell::HasInstance()); 65 DCHECK(Shell::HasInstance());
69 ShelfAlignment shelf_alignment = Shell::GetInstance()->GetShelfAlignment( 66 ShelfAlignment shelf_alignment = Shell::GetInstance()->GetShelfAlignment(
70 widget->GetNativeView()->GetRootWindow()); 67 widget->GetNativeView()->GetRootWindow());
71 gfx::Rect offseted(rect); 68 gfx::Rect offseted(rect);
72 switch (shelf_alignment) { 69 switch (shelf_alignment) {
73 case SHELF_ALIGNMENT_BOTTOM: 70 case SHELF_ALIGNMENT_BOTTOM:
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 } else if (should_snap_back_) { 553 } else if (should_snap_back_) {
557 should_snap_back_ = false; 554 should_snap_back_ = false;
558 ui::ScopedLayerAnimationSettings animation(widget_animator); 555 ui::ScopedLayerAnimationSettings animation(widget_animator);
559 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( 556 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds(
560 app_list::kOverscrollPageTransitionDurationMs)); 557 app_list::kOverscrollPageTransitionDurationMs));
561 widget->SetBounds(view_bounds_); 558 widget->SetBounds(view_bounds_);
562 } 559 }
563 } 560 }
564 561
565 } // namespace ash 562 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc ('k') | ash/wm/dock/docked_window_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698