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

Unified Diff: chrome/browser/ui/views/aura/app_list/browser_command_item.cc

Issue 8890049: [Aura] Implement views-based applist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win_aura Created 9 years 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
Index: chrome/browser/ui/views/aura/app_list/browser_command_item.cc
diff --git a/chrome/browser/ui/views/aura/app_list/browser_command_item.cc b/chrome/browser/ui/views/aura/app_list/browser_command_item.cc
new file mode 100644
index 0000000000000000000000000000000000000000..12c135e66a3e43a6c78a16a298807450aec285e2
--- /dev/null
+++ b/chrome/browser/ui/views/aura/app_list/browser_command_item.cc
@@ -0,0 +1,29 @@
+// Copyright (c) 2011 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 "chrome/browser/ui/views/aura/app_list/browser_command_item.h"
+
+#include "chrome/browser/ui/browser.h"
+#include "grit/theme_resources.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/image/image.h"
+
+BrowserCommandItem::BrowserCommandItem(Browser* browser,
+ int command_id,
+ int title_id,
+ int icon_id)
+ : browser_(browser),
+ command_id_(command_id) {
+ SetTitle(l10n_util::GetStringUTF8(title_id));
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+ SetIcon(*rb.GetImageNamed(icon_id).ToSkBitmap());
+}
+
+BrowserCommandItem::~BrowserCommandItem() {
+}
+
+void BrowserCommandItem::Activate(int event_flags) {
+ browser_->ExecuteCommand(command_id_, event_flags);
+}

Powered by Google App Engine
This is Rietveld 408576698