| 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/nacl_host/nacl_browser_delegate_impl.h" | 5 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" |
| 6 | 6 |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 std::string NaClBrowserDelegateImpl::GetVersionString() const { | 72 std::string NaClBrowserDelegateImpl::GetVersionString() const { |
| 73 return chrome::VersionInfo().CreateVersionString(); | 73 return chrome::VersionInfo().CreateVersionString(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 ppapi::host::HostFactory* NaClBrowserDelegateImpl::CreatePpapiHostFactory( | 76 ppapi::host::HostFactory* NaClBrowserDelegateImpl::CreatePpapiHostFactory( |
| 77 content::BrowserPpapiHost* ppapi_host) { | 77 content::BrowserPpapiHost* ppapi_host) { |
| 78 return new chrome::ChromeBrowserPepperHostFactory(ppapi_host); | 78 return new chrome::ChromeBrowserPepperHostFactory(ppapi_host); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void NaClBrowserDelegateImpl::TryInstallPnacl( | |
| 82 const base::Callback<void(bool)>& installed) { | |
| 83 PnaclComponentInstaller* pci = | |
| 84 g_browser_process->pnacl_component_installer(); | |
| 85 if (pci) | |
| 86 pci->RequestFirstInstall(installed); | |
| 87 else | |
| 88 installed.Run(false); | |
| 89 } | |
| 90 | |
| 91 void NaClBrowserDelegateImpl::SetDebugPatterns(std::string debug_patterns) { | 81 void NaClBrowserDelegateImpl::SetDebugPatterns(std::string debug_patterns) { |
| 92 if (!debug_patterns.empty() && debug_patterns[0] == '!') { | 82 if (!debug_patterns.empty() && debug_patterns[0] == '!') { |
| 93 inverse_debug_patterns_ = true; | 83 inverse_debug_patterns_ = true; |
| 94 debug_patterns.erase(0, 1); | 84 debug_patterns.erase(0, 1); |
| 95 } | 85 } |
| 96 if (debug_patterns.empty()) { | 86 if (debug_patterns.empty()) { |
| 97 return; | 87 return; |
| 98 } | 88 } |
| 99 std::vector<std::string> patterns; | 89 std::vector<std::string> patterns; |
| 100 base::SplitString(debug_patterns, ',', &patterns); | 90 base::SplitString(debug_patterns, ',', &patterns); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 return false; | 176 return false; |
| 187 | 177 |
| 188 // GetFilePath is a blocking function call. | 178 // GetFilePath is a blocking function call. |
| 189 const base::FilePath resource_file_path = resource.GetFilePath(); | 179 const base::FilePath resource_file_path = resource.GetFilePath(); |
| 190 if (resource_file_path.empty()) | 180 if (resource_file_path.empty()) |
| 191 return false; | 181 return false; |
| 192 | 182 |
| 193 *file_path = resource_file_path; | 183 *file_path = resource_file_path; |
| 194 return true; | 184 return true; |
| 195 } | 185 } |
| OLD | NEW |