OLD | NEW |
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/chromeos/file_manager/open_with_browser.h" | 5 #include "chrome/browser/chromeos/file_manager/open_with_browser.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "base/threading/sequenced_worker_pool.h" | 11 #include "base/threading/sequenced_worker_pool.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/chromeos/drive/file_system_util.h" | 13 #include "chrome/browser/chromeos/drive/file_system_util.h" |
14 #include "chrome/browser/chromeos/file_manager/filesystem_api_util.h" | 14 #include "chrome/browser/chromeos/file_manager/filesystem_api_util.h" |
15 #include "chrome/browser/chromeos/fileapi/external_file_url_util.h" | 15 #include "chrome/browser/chromeos/fileapi/external_file_url_util.h" |
16 #include "chrome/browser/drive/drive_api_util.h" | 16 #include "chrome/browser/drive/drive_api_util.h" |
17 #include "chrome/browser/plugins/plugin_prefs.h" | 17 #include "chrome/browser/plugins/plugin_prefs.h" |
18 #include "chrome/browser/profiles/profile_manager.h" | 18 #include "chrome/browser/profiles/profile_manager.h" |
19 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 19 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
20 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
21 #include "chrome/browser/ui/browser_tabstrip.h" | 21 #include "chrome/browser/ui/browser_tabstrip.h" |
22 #include "chrome/browser/ui/browser_window.h" | 22 #include "chrome/browser/ui/browser_window.h" |
23 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 23 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 24 #include "chrome/common/chrome_content_client.h" |
24 #include "chrome/common/chrome_paths.h" | 25 #include "chrome/common/chrome_paths.h" |
25 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
26 #include "content/public/browser/browser_thread.h" | 27 #include "content/public/browser/browser_thread.h" |
27 #include "content/public/browser/plugin_service.h" | 28 #include "content/public/browser/plugin_service.h" |
28 #include "content/public/common/pepper_plugin_info.h" | 29 #include "content/public/common/pepper_plugin_info.h" |
29 #include "net/base/filename_util.h" | 30 #include "net/base/filename_util.h" |
30 | 31 |
31 using content::BrowserThread; | 32 using content::BrowserThread; |
32 using content::PluginService; | 33 using content::PluginService; |
33 | 34 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 scoped_refptr<PluginPrefs> plugin_prefs = PluginPrefs::GetForProfile(profile); | 80 scoped_refptr<PluginPrefs> plugin_prefs = PluginPrefs::GetForProfile(profile); |
80 if (!plugin_prefs.get()) | 81 if (!plugin_prefs.get()) |
81 return false; | 82 return false; |
82 | 83 |
83 return plugin_prefs->IsPluginEnabled(pepper_info->ToWebPluginInfo()); | 84 return plugin_prefs->IsPluginEnabled(pepper_info->ToWebPluginInfo()); |
84 } | 85 } |
85 | 86 |
86 bool IsPdfPluginEnabled(Profile* profile) { | 87 bool IsPdfPluginEnabled(Profile* profile) { |
87 DCHECK(profile); | 88 DCHECK(profile); |
88 | 89 |
89 base::FilePath plugin_path; | 90 base::FilePath plugin_path = base::FilePath::FromUTF8Unsafe( |
90 PathService::Get(chrome::FILE_PDF_PLUGIN, &plugin_path); | 91 ChromeContentClient::kPDFPluginPath); |
91 return IsPepperPluginEnabled(profile, plugin_path); | 92 return IsPepperPluginEnabled(profile, plugin_path); |
92 } | 93 } |
93 | 94 |
94 bool IsFlashPluginEnabled(Profile* profile) { | 95 bool IsFlashPluginEnabled(Profile* profile) { |
95 DCHECK(profile); | 96 DCHECK(profile); |
96 | 97 |
97 base::FilePath plugin_path( | 98 base::FilePath plugin_path( |
98 base::CommandLine::ForCurrentProcess()->GetSwitchValueNative( | 99 base::CommandLine::ForCurrentProcess()->GetSwitchValueNative( |
99 switches::kPpapiFlashPath)); | 100 switches::kPpapiFlashPath)); |
100 if (plugin_path.empty()) | 101 if (plugin_path.empty()) |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 base::FilePath::FromUTF8Unsafe("dummy").AddExtension(file_extension); | 191 base::FilePath::FromUTF8Unsafe("dummy").AddExtension(file_extension); |
191 if (file_path.MatchesExtension(kPdfExtension)) | 192 if (file_path.MatchesExtension(kPdfExtension)) |
192 return IsPdfPluginEnabled(profile); | 193 return IsPdfPluginEnabled(profile); |
193 if (file_path.MatchesExtension(kSwfExtension)) | 194 if (file_path.MatchesExtension(kSwfExtension)) |
194 return IsFlashPluginEnabled(profile); | 195 return IsFlashPluginEnabled(profile); |
195 return false; | 196 return false; |
196 } | 197 } |
197 | 198 |
198 } // namespace util | 199 } // namespace util |
199 } // namespace file_manager | 200 } // namespace file_manager |
OLD | NEW |