| 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 DCHECK(!browser->profile()->IsOffTheRecord() || !service); | 240 DCHECK(!browser->profile()->IsOffTheRecord() || !service); |
| 241 enabled = service && service->HasMobiles() && | 241 enabled = service && service->HasMobiles() && |
| 242 CanSendURL(chrome::GetActiveWebContents(browser)->GetURL()); | 242 CanSendURL(chrome::GetActiveWebContents(browser)->GetURL()); |
| 243 } | 243 } |
| 244 browser->command_controller()->command_updater()-> | 244 browser->command_controller()->command_updater()-> |
| 245 UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled); | 245 UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled); |
| 246 return enabled; | 246 return enabled; |
| 247 } | 247 } |
| 248 | 248 |
| 249 // static | 249 // static |
| 250 void ChromeToMobileService::RegisterUserPrefs(PrefService* prefs) { | 250 void ChromeToMobileService::RegisterUserPrefs(PrefServiceSyncable* prefs) { |
| 251 prefs->RegisterListPref(prefs::kChromeToMobileDeviceList, | 251 prefs->RegisterListPref(prefs::kChromeToMobileDeviceList, |
| 252 PrefService::UNSYNCABLE_PREF); | 252 PrefServiceSyncable::UNSYNCABLE_PREF); |
| 253 } | 253 } |
| 254 | 254 |
| 255 ChromeToMobileService::ChromeToMobileService(Profile* profile) | 255 ChromeToMobileService::ChromeToMobileService(Profile* profile) |
| 256 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)), | 256 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)), |
| 257 profile_(profile), | 257 profile_(profile), |
| 258 sync_invalidation_enabled_(false) { | 258 sync_invalidation_enabled_(false) { |
| 259 // TODO(msw): Unit tests do not provide profiles; see http://crbug.com/122183 | 259 // TODO(msw): Unit tests do not provide profiles; see http://crbug.com/122183 |
| 260 ProfileSyncService* profile_sync_service = | 260 ProfileSyncService* profile_sync_service = |
| 261 profile_ ? ProfileSyncServiceFactory::GetForProfile(profile_) : NULL; | 261 profile_ ? ProfileSyncServiceFactory::GetForProfile(profile_) : NULL; |
| 262 if (profile_sync_service) { | 262 if (profile_sync_service) { |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 | 738 |
| 739 // Report failure below and ignore the second response. | 739 // Report failure below and ignore the second response. |
| 740 request_observer_map_.erase(other); | 740 request_observer_map_.erase(other); |
| 741 break; | 741 break; |
| 742 } | 742 } |
| 743 } | 743 } |
| 744 | 744 |
| 745 if (observer.get()) | 745 if (observer.get()) |
| 746 observer->OnSendComplete(success); | 746 observer->OnSendComplete(success); |
| 747 } | 747 } |
| OLD | NEW |