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/shelf/shelf_button_host.h" | 10 #include "ash/shelf/shelf_button_host.h" |
11 #include "ash/shelf/shelf_constants.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/accessibility/ax_view_state.h" | 14 #include "ui/accessibility/ax_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" |
22 | 22 |
23 namespace ash { | 23 namespace ash { |
24 namespace internal { | |
25 | 24 |
26 const int kAnimationDurationInMs = 600; | 25 const int kAnimationDurationInMs = 600; |
27 const float kAnimationOpacity[] = { 1.0f, 0.4f, 1.0f }; | 26 const float kAnimationOpacity[] = { 1.0f, 0.4f, 1.0f }; |
28 | 27 |
29 AppListButton::AppListButton(views::ButtonListener* listener, | 28 AppListButton::AppListButton(views::ButtonListener* listener, |
30 ShelfButtonHost* host) | 29 ShelfButtonHost* host) |
31 : views::ImageButton(listener), | 30 : views::ImageButton(listener), |
32 host_(host) { | 31 host_(host) { |
33 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 32 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
34 SetImage( | 33 SetImage( |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 void AppListButton::OnMouseExited(const ui::MouseEvent& event) { | 120 void AppListButton::OnMouseExited(const ui::MouseEvent& event) { |
122 ImageButton::OnMouseExited(event); | 121 ImageButton::OnMouseExited(event); |
123 host_->MouseExitedButton(this); | 122 host_->MouseExitedButton(this); |
124 } | 123 } |
125 | 124 |
126 void AppListButton::GetAccessibleState(ui::AXViewState* state) { | 125 void AppListButton::GetAccessibleState(ui::AXViewState* state) { |
127 state->role = ui::AX_ROLE_BUTTON; | 126 state->role = ui::AX_ROLE_BUTTON; |
128 state->name = host_->GetAccessibleName(this); | 127 state->name = host_->GetAccessibleName(this); |
129 } | 128 } |
130 | 129 |
131 } // namespace internal | |
132 } // namespace ash | 130 } // namespace ash |
OLD | NEW |