OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shelf/app_list_button.h" | 5 #include "ash/shelf/app_list_button.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
10 #include "ash/launcher/launcher_types.h" | |
11 #include "ash/shelf/shelf_button_host.h" | 10 #include "ash/shelf/shelf_button_host.h" |
| 11 #include "ash/shelf/shelf_constants.h" |
12 #include "grit/ash_resources.h" | 12 #include "grit/ash_resources.h" |
13 #include "grit/ash_strings.h" | 13 #include "grit/ash_strings.h" |
14 #include "ui/base/accessibility/accessible_view_state.h" | 14 #include "ui/base/accessibility/accessible_view_state.h" |
15 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
16 #include "ui/base/resource/resource_bundle.h" | 16 #include "ui/base/resource/resource_bundle.h" |
17 #include "ui/compositor/layer.h" | 17 #include "ui/compositor/layer.h" |
18 #include "ui/compositor/layer_animation_element.h" | 18 #include "ui/compositor/layer_animation_element.h" |
19 #include "ui/compositor/layer_animation_sequence.h" | 19 #include "ui/compositor/layer_animation_sequence.h" |
20 #include "ui/compositor/scoped_layer_animation_settings.h" | 20 #include "ui/compositor/scoped_layer_animation_settings.h" |
21 #include "ui/views/painter.h" | 21 #include "ui/views/painter.h" |
(...skipping 14 matching lines...) Expand all Loading... |
36 rb.GetImageNamed(IDR_AURA_LAUNCHER_ICON_APPLIST).ToImageSkia()); | 36 rb.GetImageNamed(IDR_AURA_LAUNCHER_ICON_APPLIST).ToImageSkia()); |
37 SetImage( | 37 SetImage( |
38 views::CustomButton::STATE_HOVERED, | 38 views::CustomButton::STATE_HOVERED, |
39 rb.GetImageNamed(IDR_AURA_LAUNCHER_ICON_APPLIST_HOT). | 39 rb.GetImageNamed(IDR_AURA_LAUNCHER_ICON_APPLIST_HOT). |
40 ToImageSkia()); | 40 ToImageSkia()); |
41 SetImage( | 41 SetImage( |
42 views::CustomButton::STATE_PRESSED, | 42 views::CustomButton::STATE_PRESSED, |
43 rb.GetImageNamed(IDR_AURA_LAUNCHER_ICON_APPLIST_PUSHED). | 43 rb.GetImageNamed(IDR_AURA_LAUNCHER_ICON_APPLIST_PUSHED). |
44 ToImageSkia()); | 44 ToImageSkia()); |
45 SetAccessibleName(l10n_util::GetStringUTF16(IDS_AURA_APP_LIST_TITLE)); | 45 SetAccessibleName(l10n_util::GetStringUTF16(IDS_AURA_APP_LIST_TITLE)); |
46 SetSize(gfx::Size(kLauncherPreferredSize, kLauncherPreferredSize)); | 46 SetSize(gfx::Size(kShelfPreferredSize, kShelfPreferredSize)); |
47 SetImageAlignment(ImageButton::ALIGN_CENTER, ImageButton::ALIGN_TOP); | 47 SetImageAlignment(ImageButton::ALIGN_CENTER, ImageButton::ALIGN_TOP); |
48 SetFocusPainter(views::Painter::CreateSolidFocusPainter( | 48 SetFocusPainter(views::Painter::CreateSolidFocusPainter( |
49 kFocusBorderColor, gfx::Insets(1, 1, 1, 1))); | 49 kFocusBorderColor, gfx::Insets(1, 1, 1, 1))); |
50 } | 50 } |
51 | 51 |
52 AppListButton::~AppListButton() { | 52 AppListButton::~AppListButton() { |
53 } | 53 } |
54 | 54 |
55 void AppListButton::StartLoadingAnimation() { | 55 void AppListButton::StartLoadingAnimation() { |
56 layer()->GetAnimator()->StopAnimating(); | 56 layer()->GetAnimator()->StopAnimating(); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 host_->MouseExitedButton(this); | 125 host_->MouseExitedButton(this); |
126 } | 126 } |
127 | 127 |
128 void AppListButton::GetAccessibleState(ui::AccessibleViewState* state) { | 128 void AppListButton::GetAccessibleState(ui::AccessibleViewState* state) { |
129 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; | 129 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; |
130 state->name = host_->GetAccessibleName(this); | 130 state->name = host_->GetAccessibleName(this); |
131 } | 131 } |
132 | 132 |
133 } // namespace internal | 133 } // namespace internal |
134 } // namespace ash | 134 } // namespace ash |
OLD | NEW |