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

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

Issue 10830140: GTK implementation of the action box button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: forward delare Created 8 years, 4 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 | « chrome/browser/ui/gtk/location_bar_view_gtk.h ('k') | chrome/browser/ui/gtk/view_id_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/location_bar_view_gtk.cc
diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.cc b/chrome/browser/ui/gtk/location_bar_view_gtk.cc
index 1c380ba9014c1a582bf3f44058a4b17d9c5b26c3..dd2d3c82f296280259759adf19130c0c0bb409ba 100644
--- a/chrome/browser/ui/gtk/location_bar_view_gtk.cc
+++ b/chrome/browser/ui/gtk/location_bar_view_gtk.cc
@@ -45,6 +45,7 @@
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
#include "chrome/browser/ui/content_settings/content_setting_image_model.h"
+#include "chrome/browser/ui/gtk/action_box_button_gtk.h"
#include "chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.h"
#include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h"
#include "chrome/browser/ui/gtk/browser_window_gtk.h"
@@ -70,6 +71,7 @@
#include "chrome/common/extensions/extension_action.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/extension_resource.h"
+#include "chrome/common/extensions/extension_switch_utils.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_service.h"
@@ -469,8 +471,23 @@ void LocationBarViewGtk::Init(bool popup_window_mode) {
// doesn't work, someone is probably calling show_all on our parent box.
gtk_box_pack_end(GTK_BOX(entry_box_), tab_to_search_hint_, FALSE, FALSE, 0);
- // Hide the star and Chrome To Mobile icons in popups, app windows, etc.
- if (browser_defaults::bookmarks_enabled && !ShouldOnlyShowLocation()) {
+ if (extensions::switch_utils::IsActionBoxEnabled()) {
+ // TODO(mpcomplete): should we hide this if ShouldOnlyShowLocation()==true?
+ action_box_button_.reset(new ActionBoxButtonGtk(browser_));
+
+ // TODO(mpcomplete): Figure out why CustomDrawButton is offset 3 pixels.
+ // This offset corrects the strange offset of CustomDrawButton.
+ const int kMagicActionBoxYOffset = 3;
+ GtkWidget* alignment = gtk_alignment_new(0, 0, 1, 1);
+ gtk_alignment_set_padding(GTK_ALIGNMENT(alignment),
+ 0, kMagicActionBoxYOffset,
+ 0, kInnerPadding);
+ gtk_container_add(GTK_CONTAINER(alignment), action_box_button_->widget());
+
+ gtk_box_pack_end(GTK_BOX(hbox_.get()), alignment,
+ FALSE, FALSE, 0);
+ } else if (browser_defaults::bookmarks_enabled && !ShouldOnlyShowLocation()) {
+ // Hide the star and Chrome To Mobile icons in popups, app windows, etc.
CreateStarButton();
gtk_box_pack_end(GTK_BOX(hbox_.get()), star_.get(), FALSE, FALSE, 0);
« no previous file with comments | « chrome/browser/ui/gtk/location_bar_view_gtk.h ('k') | chrome/browser/ui/gtk/view_id_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698