Index: chrome/browser/ui/views/location_bar/location_bar_view.cc |
=================================================================== |
--- chrome/browser/ui/views/location_bar/location_bar_view.cc (revision 137178) |
+++ chrome/browser/ui/views/location_bar/location_bar_view.cc (working copy) |
@@ -28,6 +28,7 @@ |
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
#include "chrome/browser/ui/view_ids.h" |
#include "chrome/browser/ui/views/browser_dialogs.h" |
+#include "chrome/browser/ui/views/location_bar/action_box_button_view.h" |
#include "chrome/browser/ui/views/location_bar/chrome_to_mobile_view.h" |
#include "chrome/browser/ui/views/location_bar/content_setting_image_view.h" |
#include "chrome/browser/ui/views/location_bar/ev_bubble_view.h" |
@@ -40,6 +41,7 @@ |
#include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
#include "chrome/common/chrome_notification_types.h" |
#include "chrome/common/chrome_switches.h" |
+#include "chrome/common/extensions/extension_switch_utils.h" |
#include "chrome/common/pref_names.h" |
#include "content/public/browser/notification_service.h" |
#include "content/public/browser/render_widget_host_view.h" |
@@ -142,6 +144,7 @@ |
#endif |
keyword_hint_view_(NULL), |
star_view_(NULL), |
+ action_box_button_view_(NULL), |
chrome_to_mobile_view_(NULL), |
mode_(mode), |
show_focus_rect_(false), |
@@ -229,8 +232,11 @@ |
content_blocked_view->SetVisible(false); |
} |
+ bool action_box_enabled = extensions::switch_utils::IsActionBoxEnabled(); |
+ |
// Hide the star and Chrome To Mobile icons in popups and in the app launcher. |
- if (browser_defaults::bookmarks_enabled && (mode_ == NORMAL)) { |
+ if (browser_defaults::bookmarks_enabled && (mode_ == NORMAL) && |
+ !action_box_enabled) { |
star_view_ = new StarView(command_updater_); |
AddChildView(star_view_); |
star_view_->SetVisible(true); |
@@ -248,6 +254,11 @@ |
} |
} |
+ if (action_box_enabled) { |
+ action_box_button_view_ = new ActionBoxButtonView(); |
+ AddChildView(action_box_button_view_); |
not at google - send to devlin
2012/05/17 23:40:24
nit: could you combine this with the above stateme
yefimt
2012/05/18 00:20:02
Done.
|
+ } |
+ |
// Initialize the location entry. We do this to avoid a black flash which is |
// visible when the location entry has just been initialized. |
Update(NULL); |
@@ -567,6 +578,9 @@ |
if (chrome_to_mobile_view_ && chrome_to_mobile_view_->visible()) |
entry_width -= chrome_to_mobile_view_->GetPreferredSize().width() + |
GetItemPadding(); |
+ if (action_box_button_view_) |
+ entry_width -= action_box_button_view_->GetPreferredSize().width() + |
+ GetItemPadding(); |
for (PageActionViews::const_iterator i(page_action_views_.begin()); |
i != page_action_views_.end(); ++i) { |
if ((*i)->visible()) |
@@ -643,6 +657,14 @@ |
offset -= GetItemPadding(); |
} |
+ if (action_box_button_view_) { |
+ int button_width = action_box_button_view_->GetPreferredSize().width(); |
+ offset -= button_width; |
+ action_box_button_view_->SetBounds(offset, location_y, button_width, |
+ location_height); |
+ offset -= GetItemPadding(); |
+ } |
+ |
for (PageActionViews::const_iterator i(page_action_views_.begin()); |
i != page_action_views_.end(); ++i) { |
if ((*i)->visible()) { |