Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Side by Side Diff: ash/launcher/launcher_view.cc

Issue 9307037: Reland http://codereview.chromium.org/9121050/ with fix for aura_win (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Separate ash_strings into its own gyp to break circular dependencies Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/launcher/launcher_view.h ('k') | ash/launcher/tabbed_launcher_button.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 return string16();
669 }
670
646 } // namespace internal 671 } // namespace internal
647 } // namespace ash 672 } // namespace ash
OLDNEW
« no previous file with comments | « ash/launcher/launcher_view.h ('k') | ash/launcher/tabbed_launcher_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698