| OLD | NEW |
| 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/launcher/tabbed_launcher_button.h" | 5 #include "ash/launcher/tabbed_launcher_button.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/launcher/launcher_button_host.h" | 9 #include "ash/launcher/launcher_button_host.h" |
| 10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
| 11 #include "ui/base/accessibility/accessible_view_state.h" |
| 11 #include "ui/base/animation/multi_animation.h" | 12 #include "ui/base/animation/multi_animation.h" |
| 12 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
| 13 #include "ui/gfx/canvas.h" | 14 #include "ui/gfx/canvas.h" |
| 14 #include "ui/gfx/image/image.h" | 15 #include "ui/gfx/image/image.h" |
| 15 #include "ui/gfx/insets.h" | 16 #include "ui/gfx/insets.h" |
| 16 | 17 |
| 17 namespace ash { | 18 namespace ash { |
| 18 namespace internal { | 19 namespace internal { |
| 19 | 20 |
| 20 TabbedLauncherButton::AnimationDelegateImpl::AnimationDelegateImpl( | 21 TabbedLauncherButton::AnimationDelegateImpl::AnimationDelegateImpl( |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 void TabbedLauncherButton::OnMouseMoved(const views::MouseEvent& event) { | 156 void TabbedLauncherButton::OnMouseMoved(const views::MouseEvent& event) { |
| 156 ImageButton::OnMouseMoved(event); | 157 ImageButton::OnMouseMoved(event); |
| 157 hover_controller_.SetLocation(event.location()); | 158 hover_controller_.SetLocation(event.location()); |
| 158 } | 159 } |
| 159 | 160 |
| 160 void TabbedLauncherButton::OnMouseExited(const views::MouseEvent& event) { | 161 void TabbedLauncherButton::OnMouseExited(const views::MouseEvent& event) { |
| 161 ImageButton::OnMouseExited(event); | 162 ImageButton::OnMouseExited(event); |
| 162 hover_controller_.Hide(); | 163 hover_controller_.Hide(); |
| 163 } | 164 } |
| 164 | 165 |
| 166 void TabbedLauncherButton::GetAccessibleState(ui::AccessibleViewState* state) { |
| 167 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; |
| 168 state->name = host_->GetAccessibleName(this); |
| 169 } |
| 170 |
| 165 // static | 171 // static |
| 166 TabbedLauncherButton::ImageSet* TabbedLauncherButton::CreateImageSet( | 172 TabbedLauncherButton::ImageSet* TabbedLauncherButton::CreateImageSet( |
| 167 int normal_id, | 173 int normal_id, |
| 168 int pushed_id, | 174 int pushed_id, |
| 169 int hot_id) { | 175 int hot_id) { |
| 170 ImageSet* set = new ImageSet; | 176 ImageSet* set = new ImageSet; |
| 171 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 177 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 172 set->normal_image = new SkBitmap(*rb.GetImageNamed(normal_id).ToSkBitmap()); | 178 set->normal_image = new SkBitmap(*rb.GetImageNamed(normal_id).ToSkBitmap()); |
| 173 set->pushed_image = new SkBitmap(*rb.GetImageNamed(pushed_id).ToSkBitmap()); | 179 set->pushed_image = new SkBitmap(*rb.GetImageNamed(pushed_id).ToSkBitmap()); |
| 174 set->hot_image = new SkBitmap(*rb.GetImageNamed(hot_id).ToSkBitmap()); | 180 set->hot_image = new SkBitmap(*rb.GetImageNamed(hot_id).ToSkBitmap()); |
| 175 return set; | 181 return set; |
| 176 } | 182 } |
| 177 | 183 |
| 178 } // namespace internal | 184 } // namespace internal |
| 179 } // namespace ash | 185 } // namespace ash |
| OLD | NEW |