| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/updater/extension_cache_fake.h" | 5 #include "chrome/browser/extensions/updater/extension_cache_fake.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 10 | 10 |
| 11 namespace extensions { | 11 namespace extensions { |
| 12 | 12 |
| 13 ExtensionCacheFake::ExtensionCacheFake() { | 13 ExtensionCacheFake::ExtensionCacheFake() { |
| 14 ExtensionCache::SetForTesting(this); | |
| 15 } | 14 } |
| 16 | 15 |
| 17 ExtensionCacheFake::~ExtensionCacheFake() { | 16 ExtensionCacheFake::~ExtensionCacheFake() { |
| 18 ExtensionCache::SetForTesting(NULL); | |
| 19 } | 17 } |
| 20 | 18 |
| 21 void ExtensionCacheFake::Start(const base::Closure& callback) { | 19 void ExtensionCacheFake::Start(const base::Closure& callback) { |
| 22 content::BrowserThread::PostTask( | 20 content::BrowserThread::PostTask( |
| 23 content::BrowserThread::UI, | 21 content::BrowserThread::UI, |
| 24 FROM_HERE, | 22 FROM_HERE, |
| 25 callback); | 23 callback); |
| 26 } | 24 } |
| 27 | 25 |
| 28 void ExtensionCacheFake::Shutdown(const base::Closure& callback) { | 26 void ExtensionCacheFake::Shutdown(const base::Closure& callback) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 content::BrowserThread::PostTask( | 59 content::BrowserThread::PostTask( |
| 62 content::BrowserThread::UI, | 60 content::BrowserThread::UI, |
| 63 FROM_HERE, | 61 FROM_HERE, |
| 64 base::Bind(callback, file_path, false)); | 62 base::Bind(callback, file_path, false)); |
| 65 } else { | 63 } else { |
| 66 callback.Run(file_path, true); | 64 callback.Run(file_path, true); |
| 67 } | 65 } |
| 68 } | 66 } |
| 69 | 67 |
| 70 } // namespace extensions | 68 } // namespace extensions |
| OLD | NEW |