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 #include "chrome/browser/chrome_to_mobile_service.h" | 5 #include "chrome/browser/chrome_to_mobile_service.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/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/guid.h" | 10 #include "base/guid.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 service && service->HasMobiles() && | 244 service && service->HasMobiles() && |
245 CanSendURL( | 245 CanSendURL( |
246 browser->tab_strip_model()->GetActiveWebContents()->GetURL()); | 246 browser->tab_strip_model()->GetActiveWebContents()->GetURL()); |
247 } | 247 } |
248 browser->command_controller()->command_updater()-> | 248 browser->command_controller()->command_updater()-> |
249 UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled); | 249 UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled); |
250 return enabled; | 250 return enabled; |
251 } | 251 } |
252 | 252 |
253 // static | 253 // static |
254 void ChromeToMobileService::RegisterUserPrefs(PrefRegistrySyncable* registry) { | 254 void ChromeToMobileService::RegisterUserPrefs( |
| 255 user_prefs::PrefRegistrySyncable* registry) { |
255 registry->RegisterListPref(prefs::kChromeToMobileDeviceList, | 256 registry->RegisterListPref(prefs::kChromeToMobileDeviceList, |
256 PrefRegistrySyncable::UNSYNCABLE_PREF); | 257 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
257 } | 258 } |
258 | 259 |
259 ChromeToMobileService::ChromeToMobileService(Profile* profile) | 260 ChromeToMobileService::ChromeToMobileService(Profile* profile) |
260 : weak_ptr_factory_(this), | 261 : weak_ptr_factory_(this), |
261 profile_(profile), | 262 profile_(profile), |
262 sync_invalidation_enabled_(false) { | 263 sync_invalidation_enabled_(false) { |
263 // TODO(msw): Unit tests do not provide profiles; see http://crbug.com/122183 | 264 // TODO(msw): Unit tests do not provide profiles; see http://crbug.com/122183 |
264 ProfileSyncService* profile_sync_service = | 265 ProfileSyncService* profile_sync_service = |
265 profile_ ? ProfileSyncServiceFactory::GetForProfile(profile_) : NULL; | 266 profile_ ? ProfileSyncServiceFactory::GetForProfile(profile_) : NULL; |
266 if (profile_sync_service) { | 267 if (profile_sync_service) { |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 | 753 |
753 // Report failure below and ignore the second response. | 754 // Report failure below and ignore the second response. |
754 request_observer_map_.erase(other); | 755 request_observer_map_.erase(other); |
755 break; | 756 break; |
756 } | 757 } |
757 } | 758 } |
758 | 759 |
759 if (observer.get()) | 760 if (observer.get()) |
760 observer->OnSendComplete(success); | 761 observer->OnSendComplete(success); |
761 } | 762 } |
OLD | NEW |