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

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

Issue 10905311: Consolidate bubble border code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove USE_AURA ifdef for kBigShadowImages and kSmalleShadowImages Created 8 years, 3 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 | « ash/launcher/overflow_bubble.cc ('k') | ash/wm/maximize_bubble_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/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"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 ui::Layer* GetLayer(views::Widget* widget) { 42 ui::Layer* GetLayer(views::Widget* widget) {
43 return widget->GetNativeView()->layer(); 43 return widget->GetNativeView()->layer();
44 } 44 }
45 45
46 // Gets arrow location based on shelf alignment. 46 // Gets arrow location based on shelf alignment.
47 views::BubbleBorder::ArrowLocation GetBubbleArrowLocation() { 47 views::BubbleBorder::ArrowLocation GetBubbleArrowLocation() {
48 DCHECK(Shell::HasInstance()); 48 DCHECK(Shell::HasInstance());
49 ShelfAlignment shelf_alignment = Shell::GetInstance()->GetShelfAlignment(); 49 ShelfAlignment shelf_alignment = Shell::GetInstance()->GetShelfAlignment();
50 switch (shelf_alignment) { 50 switch (shelf_alignment) {
51 case ash::SHELF_ALIGNMENT_BOTTOM: 51 case ash::SHELF_ALIGNMENT_BOTTOM:
52 return views::BubbleBorder::BOTTOM_RIGHT; 52 return views::BubbleBorder::BOTTOM_CENTER;
53 case ash::SHELF_ALIGNMENT_LEFT: 53 case ash::SHELF_ALIGNMENT_LEFT:
54 return views::BubbleBorder::LEFT_BOTTOM; 54 return views::BubbleBorder::LEFT_CENTER;
55 case ash::SHELF_ALIGNMENT_RIGHT: 55 case ash::SHELF_ALIGNMENT_RIGHT:
56 return views::BubbleBorder::RIGHT_BOTTOM; 56 return views::BubbleBorder::RIGHT_CENTER;
57 default: 57 default:
58 NOTREACHED() << "Unknown shelf alignment " << shelf_alignment; 58 NOTREACHED() << "Unknown shelf alignment " << shelf_alignment;
59 return views::BubbleBorder::BOTTOM_RIGHT; 59 return views::BubbleBorder::BOTTOM_CENTER;
60 } 60 }
61 } 61 }
62 62
63 // Offset given |rect| towards shelf. 63 // Offset given |rect| towards shelf.
64 gfx::Rect OffsetTowardsShelf(const gfx::Rect& rect) { 64 gfx::Rect OffsetTowardsShelf(const gfx::Rect& rect) {
65 DCHECK(Shell::HasInstance()); 65 DCHECK(Shell::HasInstance());
66 ShelfAlignment shelf_alignment = Shell::GetInstance()->GetShelfAlignment(); 66 ShelfAlignment shelf_alignment = Shell::GetInstance()->GetShelfAlignment();
67 gfx::Rect offseted(rect); 67 gfx::Rect offseted(rect);
68 switch (shelf_alignment) { 68 switch (shelf_alignment) {
69 case SHELF_ALIGNMENT_BOTTOM: 69 case SHELF_ALIGNMENT_BOTTOM:
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 ui::Layer* layer = GetLayer(view_->GetWidget()); 354 ui::Layer* layer = GetLayer(view_->GetWidget());
355 ui::ScopedLayerAnimationSettings animation(layer->GetAnimator()); 355 ui::ScopedLayerAnimationSettings animation(layer->GetAnimator());
356 animation.SetTransitionDuration( 356 animation.SetTransitionDuration(
357 base::TimeDelta::FromMilliseconds(kSnapBackAnimationDurationMs)); 357 base::TimeDelta::FromMilliseconds(kSnapBackAnimationDurationMs));
358 layer->SetBounds(view_bounds_); 358 layer->SetBounds(view_bounds_);
359 } 359 }
360 } 360 }
361 361
362 } // namespace internal 362 } // namespace internal
363 } // namespace ash 363 } // namespace ash
OLDNEW
« no previous file with comments | « ash/launcher/overflow_bubble.cc ('k') | ash/wm/maximize_bubble_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698