| 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/launcher/launcher_button_host.h" | 9 #include "ash/launcher/launcher_button_host.h" |
| 10 #include "ash/launcher/launcher_types.h" | 10 #include "ash/launcher/launcher_types.h" |
| 11 #include "grit/ash_resources.h" | 11 #include "grit/ash_resources.h" |
| 12 #include "grit/ash_strings.h" | 12 #include "grit/ash_strings.h" |
| 13 #include "ui/base/accessibility/accessible_view_state.h" | 13 #include "ui/base/accessibility/accessible_view_state.h" |
| 14 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
| 15 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
| 16 #include "ui/compositor/layer.h" | 16 #include "ui/compositor/layer.h" |
| 17 #include "ui/compositor/layer_animation_element.h" | 17 #include "ui/compositor/layer_animation_element.h" |
| 18 #include "ui/compositor/layer_animation_sequence.h" | 18 #include "ui/compositor/layer_animation_sequence.h" |
| 19 #include "ui/compositor/scoped_layer_animation_settings.h" | 19 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 20 | 20 |
| 21 namespace ash { | 21 namespace ash { |
| 22 namespace internal { | 22 namespace internal { |
| 23 | 23 |
| 24 namespace { | |
| 25 | |
| 26 const int kAnimationDurationInMs = 600; | 24 const int kAnimationDurationInMs = 600; |
| 27 const float kAnimationOpacity[] = { 1.0f, 0.4f, 1.0f }; | 25 const float kAnimationOpacity[] = { 1.0f, 0.4f, 1.0f }; |
| 28 const int kBorderSize = 9; | |
| 29 } // namespace | |
| 30 | 26 |
| 31 AppListButton::AppListButton(views::ButtonListener* listener, | 27 AppListButton::AppListButton(views::ButtonListener* listener, |
| 32 LauncherButtonHost* host) | 28 LauncherButtonHost* host) |
| 33 : views::ImageButton(listener), | 29 : views::ImageButton(listener), |
| 34 host_(host) { | 30 host_(host) { |
| 35 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 31 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 36 SetImage( | 32 SetImage( |
| 37 views::CustomButton::STATE_NORMAL, | 33 views::CustomButton::STATE_NORMAL, |
| 38 rb.GetImageNamed(IDR_AURA_LAUNCHER_ICON_APPLIST).ToImageSkia()); | 34 rb.GetImageNamed(IDR_AURA_LAUNCHER_ICON_APPLIST).ToImageSkia()); |
| 39 SetImage( | 35 SetImage( |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 host_->MouseExitedButton(this); | 121 host_->MouseExitedButton(this); |
| 126 } | 122 } |
| 127 | 123 |
| 128 void AppListButton::GetAccessibleState(ui::AccessibleViewState* state) { | 124 void AppListButton::GetAccessibleState(ui::AccessibleViewState* state) { |
| 129 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; | 125 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; |
| 130 state->name = host_->GetAccessibleName(this); | 126 state->name = host_->GetAccessibleName(this); |
| 131 } | 127 } |
| 132 | 128 |
| 133 } // namespace internal | 129 } // namespace internal |
| 134 } // namespace ash | 130 } // namespace ash |
| OLD | NEW |