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

Side by Side Diff: chrome/browser/download/download_shelf_context_menu.cc

Issue 1538933002: Enable download resumption by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forgot ChromeOS Created 5 years 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 unified diff | Download patch
OLDNEW
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/download/download_shelf_context_menu.h" 5 #include "chrome/browser/download/download_shelf_context_menu.h"
6 6
7 #include "base/command_line.h"
8 #include "chrome/browser/download/download_item_model.h" 7 #include "chrome/browser/download/download_item_model.h"
9 #include "chrome/grit/generated_resources.h" 8 #include "chrome/grit/generated_resources.h"
10 #include "content/public/common/content_switches.h" 9 #include "content/public/common/content_features.h"
11 #include "extensions/common/extension.h" 10 #include "extensions/common/extension.h"
12 #include "ui/base/l10n/l10n_util.h" 11 #include "ui/base/l10n/l10n_util.h"
13 12
14 #if defined(OS_WIN) 13 #if defined(OS_WIN)
15 #include "chrome/browser/ui/pdf/adobe_reader_info_win.h" 14 #include "chrome/browser/ui/pdf/adobe_reader_info_win.h"
16 #endif 15 #endif
17 16
18 using content::DownloadItem; 17 using content::DownloadItem;
19 18
20 namespace { 19 namespace {
21 20
22 // Returns true if downloads resumption is enabled. 21 // Returns true if downloads resumption is enabled.
23 bool IsDownloadResumptionEnabled() { 22 bool IsDownloadResumptionEnabled() {
24 return base::CommandLine::ForCurrentProcess()->HasSwitch( 23 return base::FeatureList::IsEnabled(features::kDownloadResumption);
25 switches::kEnableDownloadResumption);
26 } 24 }
27 25
28 } // namespace 26 } // namespace
29 27
30 DownloadShelfContextMenu::~DownloadShelfContextMenu() { 28 DownloadShelfContextMenu::~DownloadShelfContextMenu() {
31 DetachFromDownloadItem(); 29 DetachFromDownloadItem();
32 } 30 }
33 31
34 DownloadShelfContextMenu::DownloadShelfContextMenu(DownloadItem* download_item) 32 DownloadShelfContextMenu::DownloadShelfContextMenu(DownloadItem* download_item)
35 : download_item_(download_item), 33 : download_item_(download_item),
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 if (malicious_download_menu_model_) 317 if (malicious_download_menu_model_)
320 return malicious_download_menu_model_.get(); 318 return malicious_download_menu_model_.get();
321 319
322 malicious_download_menu_model_.reset(new ui::SimpleMenuModel(this)); 320 malicious_download_menu_model_.reset(new ui::SimpleMenuModel(this));
323 malicious_download_menu_model_->AddItem( 321 malicious_download_menu_model_->AddItem(
324 DownloadCommands::LEARN_MORE_SCANNING, 322 DownloadCommands::LEARN_MORE_SCANNING,
325 GetLabelForCommandId(DownloadCommands::LEARN_MORE_SCANNING)); 323 GetLabelForCommandId(DownloadCommands::LEARN_MORE_SCANNING));
326 324
327 return malicious_download_menu_model_.get(); 325 return malicious_download_menu_model_.get();
328 } 326 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698