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

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

Issue 1095083003: Ensure that by default PDFs are opened in Chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months 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
« no previous file with comments | « no previous file | chrome/browser/download/download_target_determiner_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_target_determiner.h" 5 #include "chrome/browser/download/download_target_determiner.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 mime_type, 454 mime_type,
455 IGNORE_IF_STALE_PLUGIN_LIST, 455 IGNORE_IF_STALE_PLUGIN_LIST,
456 callback))); 456 callback)));
457 return; 457 return;
458 } 458 }
459 // In practice, we assume that retrying once is enough. 459 // In practice, we assume that retrying once is enough.
460 DCHECK(!is_stale); 460 DCHECK(!is_stale);
461 bool is_handled_safely = 461 bool is_handled_safely =
462 plugin_found && 462 plugin_found &&
463 (plugin_info.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS || 463 (plugin_info.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS ||
464 plugin_info.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS); 464 plugin_info.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS ||
465 plugin_info.type == WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN);
465 BrowserThread::PostTask( 466 BrowserThread::PostTask(
466 BrowserThread::UI, FROM_HERE, base::Bind(callback, is_handled_safely)); 467 BrowserThread::UI, FROM_HERE, base::Bind(callback, is_handled_safely));
467 } 468 }
468 469
469 } // namespace 470 } // namespace
470 #endif // defined(ENABLE_PLUGINS) 471 #endif // defined(ENABLE_PLUGINS)
471 472
472 DownloadTargetDeterminer::Result 473 DownloadTargetDeterminer::Result
473 DownloadTargetDeterminer::DoDetermineIfHandledSafely() { 474 DownloadTargetDeterminer::DoDetermineIfHandledSafely() {
474 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 475 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 const base::FilePath& suggested_path) { 892 const base::FilePath& suggested_path) {
892 return base::FilePath(suggested_path.value() + kCrdownloadSuffix); 893 return base::FilePath(suggested_path.value() + kCrdownloadSuffix);
893 } 894 }
894 895
895 #if defined(OS_WIN) 896 #if defined(OS_WIN)
896 // static 897 // static
897 bool DownloadTargetDeterminer::IsAdobeReaderUpToDate() { 898 bool DownloadTargetDeterminer::IsAdobeReaderUpToDate() {
898 return g_is_adobe_reader_up_to_date_; 899 return g_is_adobe_reader_up_to_date_;
899 } 900 }
900 #endif 901 #endif
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/download_target_determiner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698