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

Side by Side Diff: ios/chrome/browser/web/chrome_web_client.mm

Issue 2647943004: Return unique_ptr from WebClient::CreateWebMainParts() (Closed)
Patch Set: Respond to comments. Created 3 years, 10 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 | « ios/chrome/browser/web/chrome_web_client.h ('k') | ios/web/app/web_main_loop.mm » ('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 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"
11 #include "base/memory/ptr_util.h"
11 #include "base/strings/sys_string_conversions.h" 12 #include "base/strings/sys_string_conversions.h"
12 #include "components/dom_distiller/core/url_constants.h" 13 #include "components/dom_distiller/core/url_constants.h"
13 #include "components/prefs/pref_service.h" 14 #include "components/prefs/pref_service.h"
14 #include "components/strings/grit/components_strings.h" 15 #include "components/strings/grit/components_strings.h"
15 #include "components/task_scheduler_util/browser/initialization.h" 16 #include "components/task_scheduler_util/browser/initialization.h"
16 #include "components/version_info/version_info.h" 17 #include "components/version_info/version_info.h"
17 #include "ios/chrome/browser/application_context.h" 18 #include "ios/chrome/browser/application_context.h"
18 #include "ios/chrome/browser/browser_about_rewriter.h" 19 #include "ios/chrome/browser/browser_about_rewriter.h"
19 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 20 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
20 #include "ios/chrome/browser/chrome_switches.h" 21 #include "ios/chrome/browser/chrome_switches.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 << base::SysNSStringToUTF8(error.description); 53 << base::SysNSStringToUTF8(error.description);
53 DCHECK(content); 54 DCHECK(content);
54 return content; 55 return content;
55 } 56 }
56 } 57 }
57 58
58 ChromeWebClient::ChromeWebClient() {} 59 ChromeWebClient::ChromeWebClient() {}
59 60
60 ChromeWebClient::~ChromeWebClient() {} 61 ChromeWebClient::~ChromeWebClient() {}
61 62
62 web::WebMainParts* ChromeWebClient::CreateWebMainParts() { 63 std::unique_ptr<web::WebMainParts> ChromeWebClient::CreateWebMainParts() {
63 return new IOSChromeMainParts(*base::CommandLine::ForCurrentProcess()); 64 return base::MakeUnique<IOSChromeMainParts>(
65 *base::CommandLine::ForCurrentProcess());
64 } 66 }
65 67
66 void ChromeWebClient::PreWebViewCreation() const { 68 void ChromeWebClient::PreWebViewCreation() const {
67 // Initialize the audio session to allow a web page's audio to continue 69 // Initialize the audio session to allow a web page's audio to continue
68 // playing after the app is backgrounded. 70 // playing after the app is backgrounded.
69 VoiceSearchProvider* voice_provider = 71 VoiceSearchProvider* voice_provider =
70 ios::GetChromeBrowserProvider()->GetVoiceSearchProvider(); 72 ios::GetChromeBrowserProvider()->GetVoiceSearchProvider();
71 if (voice_provider) { 73 if (voice_provider) {
72 AudioSessionController* audio_controller = 74 AudioSessionController* audio_controller =
73 voice_provider->GetAudioSessionController(); 75 voice_provider->GetAudioSessionController();
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // If this call fails, web will fall back to the default params. 180 // If this call fails, web will fall back to the default params.
179 *params_vector = 181 *params_vector =
180 task_scheduler_util::GetBrowserWorkerPoolParamsFromVariations(); 182 task_scheduler_util::GetBrowserWorkerPoolParamsFromVariations();
181 *index_to_traits_callback = 183 *index_to_traits_callback =
182 base::Bind(&task_scheduler_util::BrowserWorkerPoolIndexForTraits); 184 base::Bind(&task_scheduler_util::BrowserWorkerPoolIndexForTraits);
183 } 185 }
184 186
185 void ChromeWebClient::PerformExperimentalTaskSchedulerRedirections() { 187 void ChromeWebClient::PerformExperimentalTaskSchedulerRedirections() {
186 task_scheduler_util::MaybePerformBrowserTaskSchedulerRedirection(); 188 task_scheduler_util::MaybePerformBrowserTaskSchedulerRedirection();
187 } 189 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/web/chrome_web_client.h ('k') | ios/web/app/web_main_loop.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698