| 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 2279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2290 void ExtensionService::ReportExtensionLoadError( | 2290 void ExtensionService::ReportExtensionLoadError( |
| 2291 const FilePath& extension_path, | 2291 const FilePath& extension_path, |
| 2292 const std::string &error, | 2292 const std::string &error, |
| 2293 bool be_noisy) { | 2293 bool be_noisy) { |
| 2294 content::NotificationService::current()->Notify( | 2294 content::NotificationService::current()->Notify( |
| 2295 chrome::NOTIFICATION_EXTENSION_LOAD_ERROR, | 2295 chrome::NOTIFICATION_EXTENSION_LOAD_ERROR, |
| 2296 content::Source<Profile>(profile_), | 2296 content::Source<Profile>(profile_), |
| 2297 content::Details<const std::string>(&error)); | 2297 content::Details<const std::string>(&error)); |
| 2298 | 2298 |
| 2299 std::string path_str = UTF16ToUTF8(extension_path.LossyDisplayName()); | 2299 std::string path_str = UTF16ToUTF8(extension_path.LossyDisplayName()); |
| 2300 std::string message = base::StringPrintf( | 2300 string16 message = ASCIIToUTF16(base::StringPrintf( |
| 2301 "Could not load extension from '%s'. %s", | 2301 "Could not load extension from '%s'. %s", |
| 2302 path_str.c_str(), error.c_str()); | 2302 path_str.c_str(), error.c_str())); |
| 2303 ExtensionErrorReporter::GetInstance()->ReportError(message, be_noisy); | 2303 ExtensionErrorReporter::GetInstance()->ReportError(message, be_noisy); |
| 2304 } | 2304 } |
| 2305 | 2305 |
| 2306 void ExtensionService::DidCreateRenderViewForBackgroundPage( | 2306 void ExtensionService::DidCreateRenderViewForBackgroundPage( |
| 2307 ExtensionHost* host) { | 2307 ExtensionHost* host) { |
| 2308 OrphanedDevTools::iterator iter = | 2308 OrphanedDevTools::iterator iter = |
| 2309 orphaned_dev_tools_.find(host->extension_id()); | 2309 orphaned_dev_tools_.find(host->extension_id()); |
| 2310 if (iter == orphaned_dev_tools_.end()) | 2310 if (iter == orphaned_dev_tools_.end()) |
| 2311 return; | 2311 return; |
| 2312 | 2312 |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2580 const ExtensionResource &resource, | 2580 const ExtensionResource &resource, |
| 2581 int index) { | 2581 int index) { |
| 2582 // If the image failed to load (e.g. if the resource being loaded was empty) | 2582 // If the image failed to load (e.g. if the resource being loaded was empty) |
| 2583 // use the standard application icon. | 2583 // use the standard application icon. |
| 2584 if (!image || image->isNull()) | 2584 if (!image || image->isNull()) |
| 2585 image = ExtensionIconSource::LoadImageByResourceId(IDR_APP_DEFAULT_ICON); | 2585 image = ExtensionIconSource::LoadImageByResourceId(IDR_APP_DEFAULT_ICON); |
| 2586 | 2586 |
| 2587 shortcut_info_.favicon = *image; | 2587 shortcut_info_.favicon = *image; |
| 2588 web_app::CreateShortcut(profile_->GetPath(), shortcut_info_); | 2588 web_app::CreateShortcut(profile_->GetPath(), shortcut_info_); |
| 2589 } | 2589 } |
| OLD | NEW |