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/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 if (!profile_->IsOffTheRecord() && profile_->IsSyncAccessible() && | 113 if (!profile_->IsOffTheRecord() && profile_->IsSyncAccessible() && |
114 ChromeToMobileService::IsChromeToMobileEnabled()) { | 114 ChromeToMobileService::IsChromeToMobileEnabled()) { |
115 command_updater_->AddCommandObserver(IDC_CHROME_TO_MOBILE_PAGE, this); | 115 command_updater_->AddCommandObserver(IDC_CHROME_TO_MOBILE_PAGE, this); |
116 chrome_to_mobile_decoration_.reset( | 116 chrome_to_mobile_decoration_.reset( |
117 new ChromeToMobileDecoration(profile, command_updater)); | 117 new ChromeToMobileDecoration(profile, command_updater)); |
118 ChromeToMobileServiceFactory::GetForProfile(profile)-> | 118 ChromeToMobileServiceFactory::GetForProfile(profile)-> |
119 RequestMobileListUpdate(); | 119 RequestMobileListUpdate(); |
120 } | 120 } |
121 | 121 |
122 if (extensions::switch_utils::IsActionBoxEnabled()) { | 122 if (extensions::switch_utils::IsActionBoxEnabled()) { |
123 plus_decoration_.reset(new PlusDecoration(this, command_updater, browser_)); | 123 plus_decoration_.reset(new PlusDecoration(this, command_updater, browser_, |
124 profile_)); | |
Scott Hess - ex-Googler
2012/08/13 18:54:43
Make this call consistent WRT use of parameter val
beaudoin
2012/08/17 20:04:21
Good question, I did not know of browser_->profile
Scott Hess - ex-Googler
2012/08/17 20:39:15
LocationBarView* dates from deepest darkest times.
| |
124 } | 125 } |
125 | 126 |
126 for (size_t i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { | 127 for (size_t i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { |
127 DCHECK_EQ(i, content_setting_decorations_.size()); | 128 DCHECK_EQ(i, content_setting_decorations_.size()); |
128 ContentSettingsType type = static_cast<ContentSettingsType>(i); | 129 ContentSettingsType type = static_cast<ContentSettingsType>(i); |
129 content_setting_decorations_.push_back( | 130 content_setting_decorations_.push_back( |
130 new ContentSettingDecoration(type, this, profile_)); | 131 new ContentSettingDecoration(type, this, profile_)); |
131 } | 132 } |
132 | 133 |
133 registrar_.Add(this, | 134 registrar_.Add(this, |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
726 void LocationBarViewMac::UpdateChromeToMobileEnabled() { | 727 void LocationBarViewMac::UpdateChromeToMobileEnabled() { |
727 if (!chrome_to_mobile_decoration_.get()) | 728 if (!chrome_to_mobile_decoration_.get()) |
728 return; | 729 return; |
729 | 730 |
730 DCHECK(ChromeToMobileService::IsChromeToMobileEnabled()); | 731 DCHECK(ChromeToMobileService::IsChromeToMobileEnabled()); |
731 bool enabled = [field_ isEditable] && !toolbar_model_->input_in_progress() && | 732 bool enabled = [field_ isEditable] && !toolbar_model_->input_in_progress() && |
732 ChromeToMobileServiceFactory::GetForProfile(profile_)->HasMobiles(); | 733 ChromeToMobileServiceFactory::GetForProfile(profile_)->HasMobiles(); |
733 chrome_to_mobile_decoration_->SetVisible(enabled); | 734 chrome_to_mobile_decoration_->SetVisible(enabled); |
734 command_updater_->UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled); | 735 command_updater_->UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled); |
735 } | 736 } |
OLD | NEW |