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

Side by Side Diff: ios/web/shell/shell_web_client.mm

Issue 2647943004: Return unique_ptr from WebClient::CreateWebMainParts() (Closed)
Patch Set: Respond to comments. Created 3 years, 11 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/web/shell/shell_web_client.h ('k') | no next file » | 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 #import "ios/web/shell/shell_web_client.h" 5 #import "ios/web/shell/shell_web_client.h"
6 6
7 #import <UIKit/UIKit.h> 7 #import <UIKit/UIKit.h>
8 8
9 #include "base/memory/ptr_util.h"
9 #include "ios/web/public/user_agent.h" 10 #include "ios/web/public/user_agent.h"
10 #include "ios/web/shell/shell_web_main_parts.h" 11 #include "ios/web/shell/shell_web_main_parts.h"
11 12
12 #if !defined(__has_feature) || !__has_feature(objc_arc) 13 #if !defined(__has_feature) || !__has_feature(objc_arc)
13 #error "This file requires ARC support." 14 #error "This file requires ARC support."
14 #endif 15 #endif
15 16
16 namespace web { 17 namespace web {
17 18
18 ShellWebClient::ShellWebClient() { 19 ShellWebClient::ShellWebClient() {
19 } 20 }
20 21
21 ShellWebClient::~ShellWebClient() { 22 ShellWebClient::~ShellWebClient() {
22 } 23 }
23 24
24 WebMainParts* ShellWebClient::CreateWebMainParts() { 25 std::unique_ptr<WebMainParts> ShellWebClient::CreateWebMainParts() {
25 web_main_parts_.reset(new ShellWebMainParts); 26 std::unique_ptr<ShellWebMainParts> parts =
26 return web_main_parts_.get(); 27 base::MakeUnique<ShellWebMainParts>();
28 web_main_parts_ = parts.get();
29 return std::move(parts);
27 } 30 }
28 31
29 ShellBrowserState* ShellWebClient::browser_state() const { 32 ShellBrowserState* ShellWebClient::browser_state() const {
30 return web_main_parts_->browser_state(); 33 return web_main_parts_->browser_state();
31 } 34 }
32 35
33 std::string ShellWebClient::GetProduct() const { 36 std::string ShellWebClient::GetProduct() const {
34 return "CriOS/36.77.34.45"; 37 return "CriOS/36.77.34.45";
35 } 38 }
36 39
(...skipping 27 matching lines...) Expand all
64 block_callback.Run(true); 67 block_callback.Run(true);
65 }]]; 68 }]];
66 } 69 }
67 [[UIApplication sharedApplication].keyWindow.rootViewController 70 [[UIApplication sharedApplication].keyWindow.rootViewController
68 presentViewController:alert 71 presentViewController:alert
69 animated:YES 72 animated:YES
70 completion:nil]; 73 completion:nil];
71 } 74 }
72 75
73 } // namespace web 76 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/shell/shell_web_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698