| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/ptr_util.h" |
| 11 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 12 #include "chrome/browser/extensions/api/dial/dial_api_factory.h" | 13 #include "chrome/browser/extensions/api/dial/dial_api_factory.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/common/extensions/api/dial.h" | 15 #include "chrome/common/extensions/api/dial.h" |
| 15 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 16 #include "extensions/browser/event_router.h" | 17 #include "extensions/browser/event_router.h" |
| 17 #include "extensions/browser/extension_system.h" | 18 #include "extensions/browser/extension_system.h" |
| 18 | 19 |
| 19 using base::TimeDelta; | 20 using base::TimeDelta; |
| 20 using content::BrowserThread; | 21 using content::BrowserThread; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 return true; | 160 return true; |
| 160 } | 161 } |
| 161 | 162 |
| 162 void DialDiscoverNowFunction::Work() { | 163 void DialDiscoverNowFunction::Work() { |
| 163 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 164 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 164 result_ = dial_->dial_registry()->DiscoverNow(); | 165 result_ = dial_->dial_registry()->DiscoverNow(); |
| 165 } | 166 } |
| 166 | 167 |
| 167 bool DialDiscoverNowFunction::Respond() { | 168 bool DialDiscoverNowFunction::Respond() { |
| 168 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 169 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 169 SetResult(new base::FundamentalValue(result_)); | 170 SetResult(base::MakeUnique<base::FundamentalValue>(result_)); |
| 170 return true; | 171 return true; |
| 171 } | 172 } |
| 172 | 173 |
| 173 } // namespace api | 174 } // namespace api |
| 174 | 175 |
| 175 } // namespace extensions | 176 } // namespace extensions |
| OLD | NEW |