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

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

Issue 1116313002: Layout login/lock screen, shelf and app list inside the first display in Unified Desktop mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 return gfx::Vector2d(); 117 return gfx::Vector2d();
118 } 118 }
119 } 119 }
120 120
121 // Gets the point at the center of the display that a particular view is on. 121 // Gets the point at the center of the display that a particular view is on.
122 // This calculation excludes the virtual keyboard area. If the height of the 122 // This calculation excludes the virtual keyboard area. If the height of the
123 // display area is less than |minimum_height|, its bottom will be extended to 123 // display area is less than |minimum_height|, its bottom will be extended to
124 // that height (so that the app list never starts above the top of the screen). 124 // that height (so that the app list never starts above the top of the screen).
125 gfx::Point GetCenterOfDisplayForView(const views::View* view, 125 gfx::Point GetCenterOfDisplayForView(const views::View* view,
126 int minimum_height) { 126 int minimum_height) {
127 gfx::Rect bounds = Shell::GetScreen()->GetDisplayNearestWindow( 127 aura::Window* window = view->GetWidget()->GetNativeView();
128 view->GetWidget()->GetNativeView()).bounds(); 128 gfx::Rect bounds = ScreenUtil::GetShelfDisplayBoundsInScreen(window);
129 129
130 // If the virtual keyboard is active, subtract it from the display bounds, so 130 // If the virtual keyboard is active, subtract it from the display bounds, so
131 // that the app list is centered in the non-keyboard area of the display. 131 // that the app list is centered in the non-keyboard area of the display.
132 // (Note that work_area excludes the keyboard, but it doesn't get updated 132 // (Note that work_area excludes the keyboard, but it doesn't get updated
133 // until after this function is called.) 133 // until after this function is called.)
134 keyboard::KeyboardController* keyboard_controller = 134 keyboard::KeyboardController* keyboard_controller =
135 keyboard::KeyboardController::GetInstance(); 135 keyboard::KeyboardController::GetInstance();
136 if (keyboard_controller && keyboard_controller->keyboard_visible()) 136 if (keyboard_controller && keyboard_controller->keyboard_visible())
137 bounds.Subtract(keyboard_controller->current_keyboard_bounds()); 137 bounds.Subtract(keyboard_controller->current_keyboard_bounds());
138 138
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 } else if (should_snap_back_) { 534 } else if (should_snap_back_) {
535 should_snap_back_ = false; 535 should_snap_back_ = false;
536 ui::ScopedLayerAnimationSettings animation(widget_animator); 536 ui::ScopedLayerAnimationSettings animation(widget_animator);
537 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( 537 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds(
538 app_list::kOverscrollPageTransitionDurationMs)); 538 app_list::kOverscrollPageTransitionDurationMs));
539 widget->SetBounds(view_bounds_); 539 widget->SetBounds(view_bounds_);
540 } 540 }
541 } 541 }
542 542
543 } // namespace ash 543 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698