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/launcher_view.h" | 5 #include "ash/launcher/launcher_view.h" |
6 | 6 |
7 #include "ash/launcher/app_launcher_button.h" | 7 #include "ash/launcher/app_launcher_button.h" |
8 #include "ash/launcher/launcher_model.h" | 8 #include "ash/launcher/launcher_model.h" |
9 #include "ash/launcher/launcher_window_cycler.h" | 9 #include "ash/launcher/launcher_window_cycler.h" |
10 #include "ash/launcher/tabbed_launcher_button.h" | 10 #include "ash/launcher/tabbed_launcher_button.h" |
11 #include "ash/launcher/view_model.h" | 11 #include "ash/launcher/view_model.h" |
12 #include "ash/launcher/view_model_utils.h" | 12 #include "ash/launcher/view_model_utils.h" |
13 #include "ash/shell.h" | 13 #include "ash/shell.h" |
14 #include "ash/shell_delegate.h" | 14 #include "ash/shell_delegate.h" |
15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
16 #include "grit/ash_strings.h" | |
16 #include "grit/ui_resources.h" | 17 #include "grit/ui_resources.h" |
17 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
18 #include "ui/base/animation/animation.h" | 19 #include "ui/base/animation/animation.h" |
19 #include "ui/base/animation/throb_animation.h" | 20 #include "ui/base/animation/throb_animation.h" |
21 #include "ui/base/l10n/l10n_util.h" | |
20 #include "ui/base/models/simple_menu_model.h" | 22 #include "ui/base/models/simple_menu_model.h" |
21 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
22 #include "ui/gfx/compositor/layer.h" | 24 #include "ui/gfx/compositor/layer.h" |
23 #include "ui/gfx/image/image.h" | 25 #include "ui/gfx/image/image.h" |
24 #include "ui/views/animation/bounds_animator.h" | 26 #include "ui/views/animation/bounds_animator.h" |
25 #include "ui/views/controls/button/image_button.h" | 27 #include "ui/views/controls/button/image_button.h" |
26 #include "ui/views/controls/menu/menu_model_adapter.h" | 28 #include "ui/views/controls/menu/menu_model_adapter.h" |
27 #include "ui/views/controls/menu/menu_runner.h" | 29 #include "ui/views/controls/menu/menu_runner.h" |
28 #include "ui/views/widget/widget.h" | 30 #include "ui/views/widget/widget.h" |
29 | 31 |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
636 | 638 |
637 case TYPE_BROWSER_SHORTCUT: | 639 case TYPE_BROWSER_SHORTCUT: |
638 cycler_->Cycle(); | 640 cycler_->Cycle(); |
639 break; | 641 break; |
640 | 642 |
641 default: | 643 default: |
642 NOTREACHED(); | 644 NOTREACHED(); |
643 } | 645 } |
644 } | 646 } |
645 | 647 |
648 string16 LauncherView::GetAccessibleName(views::View* view) { | |
649 ShellDelegate* delegate = Shell::GetInstance()->delegate(); | |
650 if (!delegate) | |
651 return string16(); | |
652 int view_index = view_model_->GetIndexOfView(view); | |
653 // May be -1 while in the process of animating closed. | |
654 if (view_index == -1) | |
655 return string16(); | |
656 | |
657 switch (model_->items()[view_index].type) { | |
658 case TYPE_TABBED: | |
659 case TYPE_APP: | |
660 return delegate->GetLauncherItemTitle(model_->items()[view_index]); | |
661 | |
662 case TYPE_APP_LIST: | |
663 return l10n_util::GetStringUTF16(IDS_AURA_APP_LIST_TITLE); | |
664 | |
665 case TYPE_BROWSER_SHORTCUT: | |
666 return l10n_util::GetStringUTF16(IDS_AURA_CYCLER_TITLE); | |
667 | |
668 default: | |
669 NOTREACHED(); | |
tony
2012/02/06 23:16:48
Nit: If you remove default:, you'll get a compiler
Zachary Kuznia
2012/02/07 08:32:21
Done.
| |
670 } | |
671 return string16(); | |
672 } | |
673 | |
646 } // namespace internal | 674 } // namespace internal |
647 } // namespace ash | 675 } // namespace ash |
OLD | NEW |