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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 10533086: Action box menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Action box menu 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/views/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 424f5c5e50ca62297b50c809cf333cb25e92f917..ea6babf24b79fb9d09ff2b94da81830aa6181b7b 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -158,13 +158,15 @@ void LocationBarView::FadeAnimationObserver::OnImplicitAnimationsCompleted() {
// LocationBarView -----------------------------------------------------------
-LocationBarView::LocationBarView(Profile* profile,
+LocationBarView::LocationBarView(Browser* browser,
+ Profile* profile,
CommandUpdater* command_updater,
ToolbarModel* model,
Delegate* delegate,
chrome::search::SearchModel* search_model,
Mode mode)
- : profile_(profile),
+ : browser_(browser),
+ profile_(profile),
command_updater_(command_updater),
model_(model),
delegate_(delegate),
@@ -273,9 +275,8 @@ void LocationBarView::Init(views::View* popup_parent_view) {
zoom_view_ = new ZoomView(model_);
AddChildView(zoom_view_);
- if (extensions::switch_utils::IsActionBoxEnabled()) {
- action_box_button_view_ = new ActionBoxButtonView(
- extensions::ExtensionSystem::Get(profile_)->extension_service());
+ if (extensions::switch_utils::IsActionBoxEnabled() && browser_) {
+ action_box_button_view_ = new ActionBoxButtonView(browser_, profile_);
AddChildView(action_box_button_view_);
} else if (browser_defaults::bookmarks_enabled && (mode_ == NORMAL)) {
// Note: condition above means that the star and ChromeToMobile icons are
@@ -496,6 +497,8 @@ views::View* LocationBarView::GetPageActionView(ExtensionAction *page_action) {
void LocationBarView::SetStarToggled(bool on) {
if (star_view_)
star_view_->SetToggled(on);
+ if (action_box_button_view_)
+ action_box_button_view_->set_bookmark_state(on);
}
void LocationBarView::ShowStarBubble(const GURL& url, bool newly_bookmarked) {

Powered by Google App Engine
This is Rietveld 408576698