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

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

Issue 237533015: ChromeOS: Keep app list centered when the display rotates by 90 degrees. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Formatting. Created 6 years, 8 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 | ui/app_list/views/app_list_view.h » ('j') | ui/app_list/views/app_list_view.cc » ('J')
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/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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } else if (is_visible_) { 160 } else if (is_visible_) {
161 // AppListModel and AppListViewDelegate are owned by AppListView. They 161 // AppListModel and AppListViewDelegate are owned by AppListView. They
162 // will be released with AppListView on close. 162 // will be released with AppListView on close.
163 app_list::AppListView* view = new app_list::AppListView( 163 app_list::AppListView* view = new app_list::AppListView(
164 Shell::GetInstance()->delegate()->CreateAppListViewDelegate()); 164 Shell::GetInstance()->delegate()->CreateAppListViewDelegate());
165 aura::Window* root_window = window->GetRootWindow(); 165 aura::Window* root_window = window->GetRootWindow();
166 aura::Window* container = GetRootWindowController(root_window)-> 166 aura::Window* container = GetRootWindowController(root_window)->
167 GetContainer(kShellWindowId_AppListContainer); 167 GetContainer(kShellWindowId_AppListContainer);
168 if (app_list::switches::IsExperimentalAppListPositionEnabled()) { 168 if (app_list::switches::IsExperimentalAppListPositionEnabled()) {
169 // The experimental app list is centered over the primary display. 169 // The experimental app list is centered over the primary display.
170 view->InitAsBubbleAtFixedLocation( 170 view->InitAsBubbleCenteredOnPrimaryDisplay(
171 NULL, 171 NULL,
172 pagination_model_.get(), 172 pagination_model_.get(),
173 Shell::GetScreen()->GetPrimaryDisplay().bounds().CenterPoint(), 173 Shell::GetScreen(),
174 views::BubbleBorder::FLOAT, 174 views::BubbleBorder::FLOAT,
175 true /* border_accepts_events */); 175 true /* border_accepts_events */);
176 } else { 176 } else {
177 gfx::Rect applist_button_bounds = Shelf::ForWindow(container)-> 177 gfx::Rect applist_button_bounds = Shelf::ForWindow(container)->
178 GetAppListButtonView()->GetBoundsInScreen(); 178 GetAppListButtonView()->GetBoundsInScreen();
179 // We need the location of the button within the local screen. 179 // We need the location of the button within the local screen.
180 applist_button_bounds = ScreenUtil::ConvertRectFromScreen( 180 applist_button_bounds = ScreenUtil::ConvertRectFromScreen(
181 root_window, 181 root_window,
182 applist_button_bounds); 182 applist_button_bounds);
183 view->InitAsBubbleAttachedToAnchor( 183 view->InitAsBubbleAttachedToAnchor(
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 } else if (should_snap_back_) { 421 } else if (should_snap_back_) {
422 should_snap_back_ = false; 422 should_snap_back_ = false;
423 ui::ScopedLayerAnimationSettings animation(widget_animator); 423 ui::ScopedLayerAnimationSettings animation(widget_animator);
424 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( 424 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds(
425 app_list::kOverscrollPageTransitionDurationMs)); 425 app_list::kOverscrollPageTransitionDurationMs));
426 widget->SetBounds(view_bounds_); 426 widget->SetBounds(view_bounds_);
427 } 427 }
428 } 428 }
429 429
430 } // namespace ash 430 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ui/app_list/views/app_list_view.h » ('j') | ui/app_list/views/app_list_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698