| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 service && service->HasMobiles() && | 245 service && service->HasMobiles() && |
| 246 CanSendURL( | 246 CanSendURL( |
| 247 browser->tab_strip_model()->GetActiveWebContents()->GetURL()); | 247 browser->tab_strip_model()->GetActiveWebContents()->GetURL()); |
| 248 } | 248 } |
| 249 browser->command_controller()->command_updater()-> | 249 browser->command_controller()->command_updater()-> |
| 250 UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled); | 250 UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled); |
| 251 return enabled; | 251 return enabled; |
| 252 } | 252 } |
| 253 | 253 |
| 254 // static | 254 // static |
| 255 void ChromeToMobileService::RegisterUserPrefs( | 255 void ChromeToMobileService::RegisterProfilePrefs( |
| 256 user_prefs::PrefRegistrySyncable* registry) { | 256 user_prefs::PrefRegistrySyncable* registry) { |
| 257 registry->RegisterListPref(prefs::kChromeToMobileDeviceList, | 257 registry->RegisterListPref(prefs::kChromeToMobileDeviceList, |
| 258 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 258 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 259 } | 259 } |
| 260 | 260 |
| 261 ChromeToMobileService::ChromeToMobileService(Profile* profile) | 261 ChromeToMobileService::ChromeToMobileService(Profile* profile) |
| 262 : weak_ptr_factory_(this), | 262 : weak_ptr_factory_(this), |
| 263 profile_(profile), | 263 profile_(profile), |
| 264 invalidation_enabled_(false) { | 264 invalidation_enabled_(false) { |
| 265 // TODO(msw): Unit tests do not provide profiles; see http://crbug.com/122183 | 265 // TODO(msw): Unit tests do not provide profiles; see http://crbug.com/122183 |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 | 755 |
| 756 // Report failure below and ignore the second response. | 756 // Report failure below and ignore the second response. |
| 757 request_observer_map_.erase(other); | 757 request_observer_map_.erase(other); |
| 758 break; | 758 break; |
| 759 } | 759 } |
| 760 } | 760 } |
| 761 | 761 |
| 762 if (observer.get()) | 762 if (observer.get()) |
| 763 observer->OnSendComplete(success); | 763 observer->OnSendComplete(success); |
| 764 } | 764 } |
| OLD | NEW |