| 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" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 base::FilePath plugin_path; | 89 base::FilePath plugin_path; |
| 90 PathService::Get(chrome::FILE_PDF_PLUGIN, &plugin_path); | 90 PathService::Get(chrome::FILE_PDF_PLUGIN, &plugin_path); |
| 91 return IsPepperPluginEnabled(profile, plugin_path); | 91 return IsPepperPluginEnabled(profile, plugin_path); |
| 92 } | 92 } |
| 93 | 93 |
| 94 bool IsFlashPluginEnabled(Profile* profile) { | 94 bool IsFlashPluginEnabled(Profile* profile) { |
| 95 DCHECK(profile); | 95 DCHECK(profile); |
| 96 | 96 |
| 97 base::FilePath plugin_path( | 97 base::FilePath plugin_path( |
| 98 CommandLine::ForCurrentProcess()->GetSwitchValueNative( | 98 base::CommandLine::ForCurrentProcess()->GetSwitchValueNative( |
| 99 switches::kPpapiFlashPath)); | 99 switches::kPpapiFlashPath)); |
| 100 if (plugin_path.empty()) | 100 if (plugin_path.empty()) |
| 101 PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &plugin_path); | 101 PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &plugin_path); |
| 102 return IsPepperPluginEnabled(profile, plugin_path); | 102 return IsPepperPluginEnabled(profile, plugin_path); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void OpenNewTab(Profile* profile, const GURL& url) { | 105 void OpenNewTab(Profile* profile, const GURL& url) { |
| 106 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 106 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 107 | 107 |
| 108 // Check the validity of the pointer so that the closure from | 108 // Check the validity of the pointer so that the closure from |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 base::FilePath::FromUTF8Unsafe("dummy").AddExtension(file_extension); | 190 base::FilePath::FromUTF8Unsafe("dummy").AddExtension(file_extension); |
| 191 if (file_path.MatchesExtension(kPdfExtension)) | 191 if (file_path.MatchesExtension(kPdfExtension)) |
| 192 return IsPdfPluginEnabled(profile); | 192 return IsPdfPluginEnabled(profile); |
| 193 if (file_path.MatchesExtension(kSwfExtension)) | 193 if (file_path.MatchesExtension(kSwfExtension)) |
| 194 return IsFlashPluginEnabled(profile); | 194 return IsFlashPluginEnabled(profile); |
| 195 return false; | 195 return false; |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace util | 198 } // namespace util |
| 199 } // namespace file_manager | 199 } // namespace file_manager |
| OLD | NEW |