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

Side by Side Diff: ios/web_view/internal/criwv_web_client.mm

Issue 2643773005: Upstream ios/web_view source code. (Closed)
Patch Set: 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #import "ios/web_view/internal/criwv_web_client.h"
6
7 #include "base/strings/sys_string_conversions.h"
8 #include "ios/web/public/user_agent.h"
9 #include "ios/web_view/internal/criwv_browser_state.h"
10 #import "ios/web_view/internal/criwv_web_main_parts.h"
11 #import "ios/web_view/public/criwv_delegate.h"
12
13 namespace ios_web_view {
14
15 CRIWVWebClient::CRIWVWebClient(id<CRIWVDelegate> delegate)
16 : delegate_(delegate) {}
17
18 CRIWVWebClient::~CRIWVWebClient() {}
19
20 web::WebMainParts* CRIWVWebClient::CreateWebMainParts() {
21 web_main_parts_.reset(new CRIWVWebMainParts(delegate_));
sdefresne 2017/01/20 10:28:12 This is seriously incorrect as this will cause two
michaeldo 2017/01/20 18:43:30 Done. I've filed crbug.com/683207 to fix the retur
22 return web_main_parts_.get();
23 }
24
25 CRIWVBrowserState* CRIWVWebClient::browser_state() const {
26 return web_main_parts_->browser_state();
27 }
28
29 std::string CRIWVWebClient::GetProduct() const {
30 return base::SysNSStringToUTF8([delegate_ partialUserAgent]);
31 }
32
33 std::string CRIWVWebClient::GetUserAgent(bool desktop_user_agent) const {
34 std::string product = GetProduct();
35 return web::BuildUserAgentFromProduct(product);
36 }
37
38 } // namespace ios_web_view
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698