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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <limits> | 9 #include <limits> |
10 #include <set> | 10 #include <set> |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #include "content/public/browser/storage_partition.h" | 56 #include "content/public/browser/storage_partition.h" |
57 #include "content/public/browser/web_contents.h" | 57 #include "content/public/browser/web_contents.h" |
58 #include "extensions/browser/extension_registry.h" | 58 #include "extensions/browser/extension_registry.h" |
59 #include "extensions/browser/extension_system.h" | 59 #include "extensions/browser/extension_system.h" |
60 #include "extensions/browser/install/crx_install_error.h" | 60 #include "extensions/browser/install/crx_install_error.h" |
61 #include "extensions/common/extension.h" | 61 #include "extensions/common/extension.h" |
62 #include "extensions/common/extension_urls.h" | 62 #include "extensions/common/extension_urls.h" |
63 #include "extensions/common/manifest_constants.h" | 63 #include "extensions/common/manifest_constants.h" |
64 #include "extensions/common/manifest_handlers/shared_module_info.h" | 64 #include "extensions/common/manifest_handlers/shared_module_info.h" |
65 #include "net/base/escape.h" | 65 #include "net/base/escape.h" |
| 66 #include "net/traffic_annotation/network_traffic_annotation.h" |
66 #include "ui/base/l10n/l10n_util.h" | 67 #include "ui/base/l10n/l10n_util.h" |
67 #include "url/gurl.h" | 68 #include "url/gurl.h" |
68 | 69 |
69 #if defined(OS_CHROMEOS) | 70 #if defined(OS_CHROMEOS) |
70 #include "chrome/browser/chromeos/drive/file_system_util.h" | 71 #include "chrome/browser/chromeos/drive/file_system_util.h" |
71 #endif | 72 #endif |
72 | 73 |
73 using content::BrowserContext; | 74 using content::BrowserContext; |
74 using content::BrowserThread; | 75 using content::BrowserThread; |
75 using content::DownloadItem; | 76 using content::DownloadItem; |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 render_frame_host->GetRoutingID(), | 673 render_frame_host->GetRoutingID(), |
673 storage_partition->GetURLRequestContext())); | 674 storage_partition->GetURLRequestContext())); |
674 params->set_file_path(file); | 675 params->set_file_path(file); |
675 if (controller.GetVisibleEntry()) | 676 if (controller.GetVisibleEntry()) |
676 params->set_referrer(content::Referrer::SanitizeForRequest( | 677 params->set_referrer(content::Referrer::SanitizeForRequest( |
677 download_url_, content::Referrer(controller.GetVisibleEntry()->GetURL(), | 678 download_url_, content::Referrer(controller.GetVisibleEntry()->GetURL(), |
678 blink::kWebReferrerPolicyDefault))); | 679 blink::kWebReferrerPolicyDefault))); |
679 params->set_callback(base::Bind(&WebstoreInstaller::OnDownloadStarted, | 680 params->set_callback(base::Bind(&WebstoreInstaller::OnDownloadStarted, |
680 this, | 681 this, |
681 extension_id)); | 682 extension_id)); |
682 download_manager->DownloadUrl(std::move(params)); | 683 download_manager->DownloadUrl(std::move(params), NO_TRAFFIC_ANNOTATION_YET); |
683 } | 684 } |
684 | 685 |
685 void WebstoreInstaller::UpdateDownloadProgress() { | 686 void WebstoreInstaller::UpdateDownloadProgress() { |
686 // If the download has gone away, or isn't in progress (in which case we can't | 687 // If the download has gone away, or isn't in progress (in which case we can't |
687 // give a good progress estimate), stop any running timers and return. | 688 // give a good progress estimate), stop any running timers and return. |
688 if (!download_item_ || | 689 if (!download_item_ || |
689 download_item_->GetState() != DownloadItem::IN_PROGRESS) { | 690 download_item_->GetState() != DownloadItem::IN_PROGRESS) { |
690 download_progress_timer_.Stop(); | 691 download_progress_timer_.Stop(); |
691 return; | 692 return; |
692 } | 693 } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 1, | 791 1, |
791 kMaxSizeKb, | 792 kMaxSizeKb, |
792 kNumBuckets); | 793 kNumBuckets); |
793 } | 794 } |
794 UMA_HISTOGRAM_BOOLEAN( | 795 UMA_HISTOGRAM_BOOLEAN( |
795 "Extensions.WebstoreDownload.InterruptTotalSizeUnknown", | 796 "Extensions.WebstoreDownload.InterruptTotalSizeUnknown", |
796 total_bytes <= 0); | 797 total_bytes <= 0); |
797 } | 798 } |
798 | 799 |
799 } // namespace extensions | 800 } // namespace extensions |
OLD | NEW |