| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 2259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2270 void ExtensionService::ReportExtensionLoadError( | 2270 void ExtensionService::ReportExtensionLoadError( |
| 2271 const FilePath& extension_path, | 2271 const FilePath& extension_path, |
| 2272 const std::string &error, | 2272 const std::string &error, |
| 2273 bool be_noisy) { | 2273 bool be_noisy) { |
| 2274 content::NotificationService::current()->Notify( | 2274 content::NotificationService::current()->Notify( |
| 2275 chrome::NOTIFICATION_EXTENSION_LOAD_ERROR, | 2275 chrome::NOTIFICATION_EXTENSION_LOAD_ERROR, |
| 2276 content::Source<Profile>(profile_), | 2276 content::Source<Profile>(profile_), |
| 2277 content::Details<const std::string>(&error)); | 2277 content::Details<const std::string>(&error)); |
| 2278 | 2278 |
| 2279 std::string path_str = UTF16ToUTF8(extension_path.LossyDisplayName()); | 2279 std::string path_str = UTF16ToUTF8(extension_path.LossyDisplayName()); |
| 2280 std::string message = base::StringPrintf( | 2280 string16 message = ASCIIToUTF16(base::StringPrintf( |
| 2281 "Could not load extension from '%s'. %s", | 2281 "Could not load extension from '%s'. %s", |
| 2282 path_str.c_str(), error.c_str()); | 2282 path_str.c_str(), error.c_str())); |
| 2283 ExtensionErrorReporter::GetInstance()->ReportError(message, be_noisy); | 2283 ExtensionErrorReporter::GetInstance()->ReportError(message, be_noisy); |
| 2284 } | 2284 } |
| 2285 | 2285 |
| 2286 void ExtensionService::DidCreateRenderViewForBackgroundPage( | 2286 void ExtensionService::DidCreateRenderViewForBackgroundPage( |
| 2287 ExtensionHost* host) { | 2287 ExtensionHost* host) { |
| 2288 OrphanedDevTools::iterator iter = | 2288 OrphanedDevTools::iterator iter = |
| 2289 orphaned_dev_tools_.find(host->extension_id()); | 2289 orphaned_dev_tools_.find(host->extension_id()); |
| 2290 if (iter == orphaned_dev_tools_.end()) | 2290 if (iter == orphaned_dev_tools_.end()) |
| 2291 return; | 2291 return; |
| 2292 | 2292 |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2576 // | 2576 // |
| 2577 // To coexist with certain unit tests that don't have an IO thread message | 2577 // To coexist with certain unit tests that don't have an IO thread message |
| 2578 // loop available at ExtensionService shutdown, we lazy-initialize this | 2578 // loop available at ExtensionService shutdown, we lazy-initialize this |
| 2579 // object so that those cases neither create nor destroy a SocketController. | 2579 // object so that those cases neither create nor destroy a SocketController. |
| 2580 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 2580 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 2581 if (!socket_controller_) { | 2581 if (!socket_controller_) { |
| 2582 socket_controller_ = new extensions::SocketController(); | 2582 socket_controller_ = new extensions::SocketController(); |
| 2583 } | 2583 } |
| 2584 return socket_controller_; | 2584 return socket_controller_; |
| 2585 } | 2585 } |
| OLD | NEW |