| 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/webstore_installer.h" | 5 #include "chrome/browser/extensions/webstore_installer.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/download/download_util.h" | 21 #include "chrome/browser/download/download_util.h" |
| 22 #include "chrome/browser/extensions/crx_installer.h" | 22 #include "chrome/browser/extensions/crx_installer.h" |
| 23 #include "chrome/browser/extensions/install_tracker.h" | 23 #include "chrome/browser/extensions/install_tracker.h" |
| 24 #include "chrome/browser/extensions/install_tracker_factory.h" | 24 #include "chrome/browser/extensions/install_tracker_factory.h" |
| 25 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
| 26 #include "chrome/browser/ui/browser_list.h" | 26 #include "chrome/browser/ui/browser_list.h" |
| 27 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 27 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 28 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
| 29 #include "chrome/common/extensions/extension.h" | 29 #include "chrome/common/extensions/extension.h" |
| 30 #include "chrome/common/extensions/extension_constants.h" | 30 #include "chrome/common/extensions/extension_constants.h" |
| 31 #include "chrome/common/extensions/extension_manifest_constants.h" | |
| 32 #include "chrome/common/omaha_query_params/omaha_query_params.h" | 31 #include "chrome/common/omaha_query_params/omaha_query_params.h" |
| 33 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
| 34 #include "content/public/browser/download_manager.h" | 33 #include "content/public/browser/download_manager.h" |
| 35 #include "content/public/browser/download_save_info.h" | 34 #include "content/public/browser/download_save_info.h" |
| 36 #include "content/public/browser/download_url_parameters.h" | 35 #include "content/public/browser/download_url_parameters.h" |
| 37 #include "content/public/browser/navigation_controller.h" | 36 #include "content/public/browser/navigation_controller.h" |
| 38 #include "content/public/browser/navigation_entry.h" | 37 #include "content/public/browser/navigation_entry.h" |
| 39 #include "content/public/browser/notification_details.h" | 38 #include "content/public/browser/notification_details.h" |
| 40 #include "content/public/browser/notification_service.h" | 39 #include "content/public/browser/notification_service.h" |
| 41 #include "content/public/browser/notification_source.h" | 40 #include "content/public/browser/notification_source.h" |
| 42 #include "content/public/browser/render_process_host.h" | 41 #include "content/public/browser/render_process_host.h" |
| 43 #include "content/public/browser/render_view_host.h" | 42 #include "content/public/browser/render_view_host.h" |
| 44 #include "content/public/browser/web_contents.h" | 43 #include "content/public/browser/web_contents.h" |
| 44 #include "extensions/common/manifest_constants.h" |
| 45 #include "net/base/escape.h" | 45 #include "net/base/escape.h" |
| 46 #include "url/gurl.h" | 46 #include "url/gurl.h" |
| 47 | 47 |
| 48 #if defined(OS_CHROMEOS) | 48 #if defined(OS_CHROMEOS) |
| 49 #include "chrome/browser/chromeos/drive/file_system_util.h" | 49 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 50 #endif | 50 #endif |
| 51 | 51 |
| 52 using chrome::OmahaQueryParams; | 52 using chrome::OmahaQueryParams; |
| 53 using content::BrowserContext; | 53 using content::BrowserContext; |
| 54 using content::BrowserThread; | 54 using content::BrowserThread; |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 231 } |
| 232 | 232 |
| 233 base::FilePath download_path = DownloadPrefs::FromDownloadManager( | 233 base::FilePath download_path = DownloadPrefs::FromDownloadManager( |
| 234 BrowserContext::GetDownloadManager(profile_))->DownloadPath(); | 234 BrowserContext::GetDownloadManager(profile_))->DownloadPath(); |
| 235 BrowserThread::PostTask( | 235 BrowserThread::PostTask( |
| 236 BrowserThread::FILE, FROM_HERE, | 236 BrowserThread::FILE, FROM_HERE, |
| 237 base::Bind(&GetDownloadFilePath, download_path, id_, | 237 base::Bind(&GetDownloadFilePath, download_path, id_, |
| 238 base::Bind(&WebstoreInstaller::StartDownload, this))); | 238 base::Bind(&WebstoreInstaller::StartDownload, this))); |
| 239 | 239 |
| 240 std::string name; | 240 std::string name; |
| 241 if (!approval_->manifest->value()->GetString(extension_manifest_keys::kName, | 241 if (!approval_->manifest->value()->GetString(manifest_keys::kName, &name)) { |
| 242 &name)) { | |
| 243 NOTREACHED(); | 242 NOTREACHED(); |
| 244 } | 243 } |
| 245 extensions::InstallTracker* tracker = | 244 extensions::InstallTracker* tracker = |
| 246 extensions::InstallTrackerFactory::GetForProfile(profile_); | 245 extensions::InstallTrackerFactory::GetForProfile(profile_); |
| 247 tracker->OnBeginExtensionInstall( | 246 tracker->OnBeginExtensionInstall( |
| 248 id_, name, approval_->installing_icon, approval_->manifest->is_app(), | 247 id_, name, approval_->installing_icon, approval_->manifest->is_app(), |
| 249 approval_->manifest->is_platform_app()); | 248 approval_->manifest->is_platform_app()); |
| 250 } | 249 } |
| 251 | 250 |
| 252 void WebstoreInstaller::Observe(int type, | 251 void WebstoreInstaller::Observe(int type, |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 void WebstoreInstaller::ReportSuccess() { | 459 void WebstoreInstaller::ReportSuccess() { |
| 461 if (delegate_) { | 460 if (delegate_) { |
| 462 delegate_->OnExtensionInstallSuccess(id_); | 461 delegate_->OnExtensionInstallSuccess(id_); |
| 463 delegate_ = NULL; | 462 delegate_ = NULL; |
| 464 } | 463 } |
| 465 | 464 |
| 466 Release(); // Balanced in Start(). | 465 Release(); // Balanced in Start(). |
| 467 } | 466 } |
| 468 | 467 |
| 469 } // namespace extensions | 468 } // namespace extensions |
| OLD | NEW |