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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 ListValue empty; | 466 ListValue empty; |
467 profile_->GetPrefs()->Set(prefs::kChromeToMobileDeviceList, empty); | 467 profile_->GetPrefs()->Set(prefs::kChromeToMobileDeviceList, empty); |
468 } | 468 } |
469 | 469 |
470 void ChromeToMobileService::OnInvalidatorStateChange( | 470 void ChromeToMobileService::OnInvalidatorStateChange( |
471 syncer::InvalidatorState state) { | 471 syncer::InvalidatorState state) { |
472 sync_invalidation_enabled_ = (state == syncer::INVALIDATIONS_ENABLED); | 472 sync_invalidation_enabled_ = (state == syncer::INVALIDATIONS_ENABLED); |
473 } | 473 } |
474 | 474 |
475 void ChromeToMobileService::OnIncomingInvalidation( | 475 void ChromeToMobileService::OnIncomingInvalidation( |
476 const syncer::ObjectIdInvalidationMap& invalidation_map, | 476 const syncer::ObjectIdInvalidationMap& invalidation_map) { |
477 syncer::IncomingInvalidationSource source) { | |
478 DCHECK_EQ(1U, invalidation_map.size()); | 477 DCHECK_EQ(1U, invalidation_map.size()); |
479 DCHECK_EQ(1U, invalidation_map.count(invalidation::ObjectId( | 478 DCHECK_EQ(1U, invalidation_map.count(invalidation::ObjectId( |
480 ipc::invalidation::ObjectSource::CHROME_COMPONENTS, | 479 ipc::invalidation::ObjectSource::CHROME_COMPONENTS, |
481 kSyncInvalidationObjectIdChromeToMobileDeviceList))); | 480 kSyncInvalidationObjectIdChromeToMobileDeviceList))); |
482 RequestDeviceSearch(); | 481 RequestDeviceSearch(); |
483 } | 482 } |
484 | 483 |
485 const std::string& ChromeToMobileService::GetAccessTokenForTest() const { | 484 const std::string& ChromeToMobileService::GetAccessTokenForTest() const { |
486 return access_token_; | 485 return access_token_; |
487 } | 486 } |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 | 741 |
743 // Report failure below and ignore the second response. | 742 // Report failure below and ignore the second response. |
744 request_observer_map_.erase(other); | 743 request_observer_map_.erase(other); |
745 break; | 744 break; |
746 } | 745 } |
747 } | 746 } |
748 | 747 |
749 if (observer.get()) | 748 if (observer.get()) |
750 observer->OnSendComplete(success); | 749 observer->OnSendComplete(success); |
751 } | 750 } |
OLD | NEW |