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

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

Issue 1913553002: Fix compile failures from shelf locking merge CL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Update GetAlignment function call. Created 4 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
« no previous file with comments | « no previous file | ash/wm/app_list_controller.cc » ('j') | 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_shower_delegate.h" 5 #include "ash/app_list/app_list_shower_delegate.h"
6 6
7 #include "ash/app_list/app_list_view_delegate_factory.h" 7 #include "ash/app_list/app_list_view_delegate_factory.h"
8 #include "ash/ash_switches.h" 8 #include "ash/ash_switches.h"
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/screen_util.h" 10 #include "ash/screen_util.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // Using |button_bounds|, determine the anchor offset so that the bubble gets 49 // Using |button_bounds|, determine the anchor offset so that the bubble gets
50 // shown above the shelf (used for the alternate shelf theme). 50 // shown above the shelf (used for the alternate shelf theme).
51 gfx::Vector2d GetAnchorPositionOffsetToShelf( 51 gfx::Vector2d GetAnchorPositionOffsetToShelf(
52 const gfx::Rect& button_bounds, views::Widget* widget) { 52 const gfx::Rect& button_bounds, views::Widget* widget) {
53 DCHECK(Shell::HasInstance()); 53 DCHECK(Shell::HasInstance());
54 ShelfAlignment shelf_alignment = Shell::GetInstance()->GetShelfAlignment( 54 ShelfAlignment shelf_alignment = Shell::GetInstance()->GetShelfAlignment(
55 widget->GetNativeView()->GetRootWindow()); 55 widget->GetNativeView()->GetRootWindow());
56 gfx::Point anchor(button_bounds.CenterPoint()); 56 gfx::Point anchor(button_bounds.CenterPoint());
57 switch (shelf_alignment) { 57 switch (shelf_alignment) {
58 case SHELF_ALIGNMENT_BOTTOM: 58 case SHELF_ALIGNMENT_BOTTOM:
59 case SHELF_ALIGNMENT_BOTTOM_LOCKED:
59 if (base::i18n::IsRTL()) { 60 if (base::i18n::IsRTL()) {
60 int screen_width = widget->GetWorkAreaBoundsInScreen().width(); 61 int screen_width = widget->GetWorkAreaBoundsInScreen().width();
61 return gfx::Vector2d( 62 return gfx::Vector2d(
62 std::min(screen_width - kMinimalAnchorPositionOffset - anchor.x(), 63 std::min(screen_width - kMinimalAnchorPositionOffset - anchor.x(),
63 0), 0); 64 0), 0);
64 } 65 }
65 return gfx::Vector2d( 66 return gfx::Vector2d(
66 std::max(kMinimalAnchorPositionOffset - anchor.x(), 0), 0); 67 std::max(kMinimalAnchorPositionOffset - anchor.x(), 0), 0);
67 case SHELF_ALIGNMENT_LEFT: 68 case SHELF_ALIGNMENT_LEFT:
68 return gfx::Vector2d( 69 return gfx::Vector2d(
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // App list needs to know the new shelf layout in order to calculate its 255 // App list needs to know the new shelf layout in order to calculate its
255 // UI layout when AppListView visibility changes. 256 // UI layout when AppListView visibility changes.
256 Shell::GetPrimaryRootWindowController() 257 Shell::GetPrimaryRootWindowController()
257 ->GetShelfLayoutManager() 258 ->GetShelfLayoutManager()
258 ->UpdateAutoHideState(); 259 ->UpdateAutoHideState();
259 260
260 ShelfAlignment shelf_alignment = 261 ShelfAlignment shelf_alignment =
261 Shell::GetInstance()->GetShelfAlignment(root_window); 262 Shell::GetInstance()->GetShelfAlignment(root_window);
262 switch (shelf_alignment) { 263 switch (shelf_alignment) {
263 case SHELF_ALIGNMENT_BOTTOM: 264 case SHELF_ALIGNMENT_BOTTOM:
265 case SHELF_ALIGNMENT_BOTTOM_LOCKED:
264 return gfx::Vector2d(0, kAnimationOffset); 266 return gfx::Vector2d(0, kAnimationOffset);
265 case SHELF_ALIGNMENT_LEFT: 267 case SHELF_ALIGNMENT_LEFT:
266 return gfx::Vector2d(-kAnimationOffset, 0); 268 return gfx::Vector2d(-kAnimationOffset, 0);
267 case SHELF_ALIGNMENT_RIGHT: 269 case SHELF_ALIGNMENT_RIGHT:
268 return gfx::Vector2d(kAnimationOffset, 0); 270 return gfx::Vector2d(kAnimationOffset, 0);
269 } 271 }
270 NOTREACHED(); 272 NOTREACHED();
271 return gfx::Vector2d(); 273 return gfx::Vector2d();
272 } 274 }
273 275
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 } 350 }
349 351
350 //////////////////////////////////////////////////////////////////////////////// 352 ////////////////////////////////////////////////////////////////////////////////
351 // AppListShowerDelegate, ShelfIconObserver implementation: 353 // AppListShowerDelegate, ShelfIconObserver implementation:
352 354
353 void AppListShowerDelegate::OnShelfIconPositionsChanged() { 355 void AppListShowerDelegate::OnShelfIconPositionsChanged() {
354 UpdateBounds(); 356 UpdateBounds();
355 } 357 }
356 358
357 } // namespace ash 359 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/wm/app_list_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698