| 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/extensions/api/dial/dial_api.h" | 5 #include "chrome/browser/extensions/api/dial/dial_api.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "chrome/browser/extensions/api/dial/dial_api_factory.h" | 10 #include "chrome/browser/extensions/api/dial/dial_api_factory.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 void DialAPI::OnListenerRemoved(const EventListenerInfo& details) { | 66 void DialAPI::OnListenerRemoved(const EventListenerInfo& details) { |
| 67 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 67 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 68 BrowserThread::PostTask( | 68 BrowserThread::PostTask( |
| 69 BrowserThread::IO, FROM_HERE, | 69 BrowserThread::IO, FROM_HERE, |
| 70 base::Bind(&DialAPI::NotifyListenerRemovedOnIOThread, this)); | 70 base::Bind(&DialAPI::NotifyListenerRemovedOnIOThread, this)); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void DialAPI::NotifyListenerAddedOnIOThread() { | 73 void DialAPI::NotifyListenerAddedOnIOThread() { |
| 74 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 74 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 75 VLOG(1) << "DIAL device event listener added."; | 75 VLOG(2) << "DIAL device event listener added."; |
| 76 dial_registry()->OnListenerAdded(); | 76 dial_registry()->OnListenerAdded(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void DialAPI::NotifyListenerRemovedOnIOThread() { | 79 void DialAPI::NotifyListenerRemovedOnIOThread() { |
| 80 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 80 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 81 VLOG(1) << "DIAL device event listener removed"; | 81 VLOG(2) << "DIAL device event listener removed"; |
| 82 dial_registry()->OnListenerRemoved(); | 82 dial_registry()->OnListenerRemoved(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void DialAPI::OnDialDeviceEvent(const DialRegistry::DeviceList& devices) { | 85 void DialAPI::OnDialDeviceEvent(const DialRegistry::DeviceList& devices) { |
| 86 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 86 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 87 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 87 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 88 base::Bind(&DialAPI::SendEventOnUIThread, this, devices)); | 88 base::Bind(&DialAPI::SendEventOnUIThread, this, devices)); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void DialAPI::OnDialError(const DialRegistry::DialErrorCode code) { | 91 void DialAPI::OnDialError(const DialRegistry::DialErrorCode code) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 if (!result_) | 166 if (!result_) |
| 167 error_ = kDialServiceError; | 167 error_ = kDialServiceError; |
| 168 | 168 |
| 169 SetResult(new base::FundamentalValue(result_)); | 169 SetResult(new base::FundamentalValue(result_)); |
| 170 return true; | 170 return true; |
| 171 } | 171 } |
| 172 | 172 |
| 173 } // namespace api | 173 } // namespace api |
| 174 | 174 |
| 175 } // namespace extensions | 175 } // namespace extensions |
| OLD | NEW |