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

Unified Diff: chrome/browser/ui/gtk/action_box_button_gtk.cc

Issue 10830140: GTK implementation of the action box button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
Index: chrome/browser/ui/gtk/action_box_button_gtk.cc
diff --git a/chrome/browser/ui/gtk/action_box_button_gtk.cc b/chrome/browser/ui/gtk/action_box_button_gtk.cc
new file mode 100644
index 0000000000000000000000000000000000000000..da99b2414309d97a33a3ce41070bb4c0cc91af35
--- /dev/null
+++ b/chrome/browser/ui/gtk/action_box_button_gtk.cc
@@ -0,0 +1,37 @@
+// Copyright (c) 2012 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/gtk/action_box_button_gtk.h"
+
+#include <gtk/gtk.h>
+
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/gtk/view_id_util.h"
+#include "chrome/browser/ui/view_ids.h"
+#include "grit/generated_resources.h"
+#include "grit/theme_resources.h"
+#include "ui/base/l10n/l10n_util.h"
+
+ActionBoxButtonGtk::ActionBoxButtonGtk(Browser* browser) : browser_(browser) {
+ button_.reset(new CustomDrawButton(
+ IDR_ACTION_BOX_BUTTON,
+ IDR_ACTION_BOX_BUTTON_PRESSED,
+ IDR_ACTION_BOX_BUTTON_PRESSED, // TODO: hover
+ 0)); // TODO: disabled?
+ gtk_widget_set_tooltip_text(widget(),
+ l10n_util::GetStringUTF8(IDS_TOOLTIP_ACTION_BOX_BUTTON).c_str());
+
+ g_signal_connect(widget(), "clicked",
+ G_CALLBACK(OnClickThunk), this);
+
+ ViewIDUtil::SetID(widget(), VIEW_ID_ACTION_BOX_BUTTON);
+}
+
+ActionBoxButtonGtk::~ActionBoxButtonGtk() {
+}
+
+void ActionBoxButtonGtk::OnClick(GtkWidget* widget) {
+ // TODO(mpcomplete): show the menu. See back_forward_button_gtk for menu
+ // stuff.
+}

Powered by Google App Engine
This is Rietveld 408576698