OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |