Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: trunk/src/chrome/browser/download/download_item_model.cc

Issue 61623006: Revert 233460 "Prefer opening PDF downloads in the browser." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/chrome/browser/download/download_item_model.cc
===================================================================
--- trunk/src/chrome/browser/download/download_item_model.cc (revision 233496)
+++ trunk/src/chrome/browser/download/download_item_model.cc (working copy)
@@ -12,11 +12,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/supports_user_data.h"
#include "base/time/time.h"
-#include "chrome/browser/download/chrome_download_manager_delegate.h"
#include "chrome/browser/download/download_crx_util.h"
-#include "chrome/browser/download/download_service.h"
-#include "chrome/browser/download/download_service_factory.h"
-#include "chrome/browser/download/download_stats.h"
#include "chrome/browser/safe_browsing/download_feedback_service.h"
#include "content/public/browser/download_danger_type.h"
#include "content/public/browser/download_interrupt_reasons.h"
@@ -56,13 +52,6 @@
should_notify_ui_ = should_notify_ui;
}
- bool should_prefer_opening_in_browser() const {
- return should_prefer_opening_in_browser_;
- }
- void set_should_prefer_opening_in_browser(bool preference) {
- should_prefer_opening_in_browser_ = preference;
- }
-
private:
DownloadItemModelData();
virtual ~DownloadItemModelData() {}
@@ -76,10 +65,6 @@
// Whether the UI should be notified when the download is ready to be
// presented.
bool should_notify_ui_;
-
- // Whether the download should be opened in the browser vs. the system handler
- // for the file type.
- bool should_prefer_opening_in_browser_;
};
// static
@@ -105,8 +90,7 @@
DownloadItemModelData::DownloadItemModelData()
: should_show_in_shelf_(true),
- should_notify_ui_(false),
- should_prefer_opening_in_browser_(false) {
+ should_notify_ui_(false) {
}
string16 InterruptReasonStatusMessage(int reason) {
@@ -548,16 +532,6 @@
data->set_should_notify_ui(should_notify);
}
-bool DownloadItemModel::ShouldPreferOpeningInBrowser() const {
- const DownloadItemModelData* data = DownloadItemModelData::Get(download_);
- return data && data->should_prefer_opening_in_browser();
-}
-
-void DownloadItemModel::SetShouldPreferOpeningInBrowser(bool preference) {
- DownloadItemModelData* data = DownloadItemModelData::GetOrCreate(download_);
- data->set_should_prefer_opening_in_browser(preference);
-}
-
string16 DownloadItemModel::GetProgressSizesString() const {
string16 size_ratio;
int64 size = GetCompletedBytes();
@@ -631,18 +605,3 @@
// Instead of displaying "0 B" we say "Starting..."
return l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_STARTING);
}
-
-void DownloadItemModel::OpenUsingPlatformHandler() {
- DownloadService* download_service =
- DownloadServiceFactory::GetForBrowserContext(
- download_->GetBrowserContext());
- if (!download_service)
- return;
-
- ChromeDownloadManagerDelegate* delegate =
- download_service->GetDownloadManagerDelegate();
- if (!delegate)
- return;
- delegate->OpenDownloadUsingPlatformHandler(download_);
- RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_USER_PLATFORM);
-}

Powered by Google App Engine
This is Rietveld 408576698