| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ios/chrome/browser/web/chrome_web_client.h" | 5 #include "ios/chrome/browser/web/chrome_web_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/ios/ios_util.h" | 9 #include "base/ios/ios_util.h" |
| 10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" | 27 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
| 28 #include "ios/public/provider/chrome/browser/voice/audio_session_controller.h" | 28 #include "ios/public/provider/chrome/browser/voice/audio_session_controller.h" |
| 29 #include "ios/public/provider/chrome/browser/voice/voice_search_provider.h" | 29 #include "ios/public/provider/chrome/browser/voice/voice_search_provider.h" |
| 30 #include "ios/web/public/browser_url_rewriter.h" | 30 #include "ios/web/public/browser_url_rewriter.h" |
| 31 #include "ios/web/public/user_agent.h" | 31 #include "ios/web/public/user_agent.h" |
| 32 #include "net/http/http_util.h" | 32 #include "net/http/http_util.h" |
| 33 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
| 34 #include "ui/base/resource/resource_bundle.h" | 34 #include "ui/base/resource/resource_bundle.h" |
| 35 #include "url/gurl.h" | 35 #include "url/gurl.h" |
| 36 | 36 |
| 37 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 38 #error "This file requires ARC support." |
| 39 #endif |
| 40 |
| 37 namespace { | 41 namespace { |
| 38 // Returns an autoreleased string containing the JavaScript loaded from a | 42 // Returns an autoreleased string containing the JavaScript loaded from a |
| 39 // bundled resource file with the given name (excluding extension). | 43 // bundled resource file with the given name (excluding extension). |
| 40 NSString* GetPageScript(NSString* script_file_name) { | 44 NSString* GetPageScript(NSString* script_file_name) { |
| 41 DCHECK(script_file_name); | 45 DCHECK(script_file_name); |
| 42 NSString* path = | 46 NSString* path = |
| 43 [base::mac::FrameworkBundle() pathForResource:script_file_name | 47 [base::mac::FrameworkBundle() pathForResource:script_file_name |
| 44 ofType:@"js"]; | 48 ofType:@"js"]; |
| 45 DCHECK(path) << "Script file not found: " | 49 DCHECK(path) << "Script file not found: " |
| 46 << base::SysNSStringToUTF8(script_file_name) << ".js"; | 50 << base::SysNSStringToUTF8(script_file_name) << ".js"; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 176 } |
| 173 | 177 |
| 174 std::unique_ptr<base::TaskScheduler::InitParams> | 178 std::unique_ptr<base::TaskScheduler::InitParams> |
| 175 ChromeWebClient::GetTaskSchedulerInitParams() { | 179 ChromeWebClient::GetTaskSchedulerInitParams() { |
| 176 return task_scheduler_util::GetBrowserTaskSchedulerInitParamsFromVariations(); | 180 return task_scheduler_util::GetBrowserTaskSchedulerInitParamsFromVariations(); |
| 177 } | 181 } |
| 178 | 182 |
| 179 void ChromeWebClient::PerformExperimentalTaskSchedulerRedirections() { | 183 void ChromeWebClient::PerformExperimentalTaskSchedulerRedirections() { |
| 180 task_scheduler_util::MaybePerformBrowserTaskSchedulerRedirection(); | 184 task_scheduler_util::MaybePerformBrowserTaskSchedulerRedirection(); |
| 181 } | 185 } |
| OLD | NEW |