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

Unified Diff: ui/app_list/app_list_menu.cc

Issue 12789010: [win] Change app launcher profile indicator to be a menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clang fail Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/app_list_menu.h ('k') | ui/app_list/app_list_view_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/app_list_menu.cc
diff --git a/ui/app_list/app_list_menu.cc b/ui/app_list/app_list_menu.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f02a6ef99ab2ec4e1410eb76b9a2750a8382576b
--- /dev/null
+++ b/ui/app_list/app_list_menu.cc
@@ -0,0 +1,62 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/app_list/app_list_menu.h"
+
+#include "grit/ui_strings.h"
+#include "ui/app_list/app_list_view_delegate.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/models/menu_separator_types.h"
+#include "ui/base/resource/resource_bundle.h"
+
+namespace app_list {
+
+AppListMenu::AppListMenu(AppListViewDelegate* delegate)
+ : ALLOW_THIS_IN_INITIALIZER_LIST(menu_model_(this)),
+ delegate_(delegate) {
+ InitMenu();
+}
+
+AppListMenu::~AppListMenu() {}
+
+void AppListMenu::InitMenu() {
+ menu_model_.AddItem(CURRENT_USER, string16());
+ menu_model_.AddSeparator(ui::NORMAL_SEPARATOR);
+
+ menu_model_.AddItem(SHOW_SETTINGS, l10n_util::GetStringUTF16(
+ IDS_APP_LIST_OPEN_SETTINGS));
+
+ menu_model_.AddItem(SHOW_FEEDBACK, l10n_util::GetStringUTF16(
+ IDS_APP_LIST_OPEN_FEEDBACK));
+}
+
+bool AppListMenu::IsCommandIdChecked(int command_id) const {
+ return false;
+}
+
+bool AppListMenu::IsCommandIdEnabled(int command_id) const {
+ return true;
+}
+
+bool AppListMenu::GetAcceleratorForCommandId(int command_id,
+ ui::Accelerator* accelerator) {
+ return false;
+}
+
+void AppListMenu::ExecuteCommand(int command_id, int event_flags) {
+ switch (command_id) {
+ case CURRENT_USER:
+ break; // Do nothing.
+ case SHOW_SETTINGS:
+ delegate_->OpenSettings();
+ break;
+ case SHOW_FEEDBACK:
+ delegate_->OpenFeedback();
+ break;
+ default:
+ NOTREACHED();
+ }
+}
+
+} // namespace app_list
« no previous file with comments | « ui/app_list/app_list_menu.h ('k') | ui/app_list/app_list_view_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698