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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm

Issue 10887029: Only show chrome2mobile in action box if it is enabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" 5 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // or if the feature is disabled by a command line flag or chrome://flags. 117 // or if the feature is disabled by a command line flag or chrome://flags.
118 if (!profile_->IsOffTheRecord() && profile_->IsSyncAccessible() && 118 if (!profile_->IsOffTheRecord() && profile_->IsSyncAccessible() &&
119 ChromeToMobileService::IsChromeToMobileEnabled()) { 119 ChromeToMobileService::IsChromeToMobileEnabled()) {
120 command_updater_->AddCommandObserver(IDC_CHROME_TO_MOBILE_PAGE, this); 120 command_updater_->AddCommandObserver(IDC_CHROME_TO_MOBILE_PAGE, this);
121 chrome_to_mobile_decoration_.reset( 121 chrome_to_mobile_decoration_.reset(
122 new ChromeToMobileDecoration(profile, command_updater)); 122 new ChromeToMobileDecoration(profile, command_updater));
123 UpdateChromeToMobileEnabled(); 123 UpdateChromeToMobileEnabled();
124 } 124 }
125 125
126 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableActionBox)) { 126 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableActionBox)) {
127 plus_decoration_.reset(new PlusDecoration(this, command_updater, browser_)); 127 plus_decoration_.reset(new PlusDecoration(this, browser_));
128 } 128 }
129 129
130 for (size_t i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { 130 for (size_t i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) {
131 DCHECK_EQ(i, content_setting_decorations_.size()); 131 DCHECK_EQ(i, content_setting_decorations_.size());
132 ContentSettingsType type = static_cast<ContentSettingsType>(i); 132 ContentSettingsType type = static_cast<ContentSettingsType>(i);
133 content_setting_decorations_.push_back( 133 content_setting_decorations_.push_back(
134 new ContentSettingDecoration(type, this, profile_)); 134 new ContentSettingDecoration(type, this, profile_));
135 } 135 }
136 136
137 registrar_.Add(this, 137 registrar_.Add(this,
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 775
776 void LocationBarViewMac::UpdateStarDecorationVisibility() { 776 void LocationBarViewMac::UpdateStarDecorationVisibility() {
777 bool action_box_enabled = 777 bool action_box_enabled =
778 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableActionBox); 778 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableActionBox);
779 // If the action box is enabled, only show the star if it's lit. 779 // If the action box is enabled, only show the star if it's lit.
780 bool visible = IsStarEnabled(); 780 bool visible = IsStarEnabled();
781 if (!star_decoration_->starred() && action_box_enabled) 781 if (!star_decoration_->starred() && action_box_enabled)
782 visible = false; 782 visible = false;
783 star_decoration_->SetVisible(visible); 783 star_decoration_->SetVisible(visible);
784 } 784 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698