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

Side by Side Diff: content/public/common/content_client.cc

Issue 178263007: Simplify the user agent overriding code, in preparation for moving it out of src/webkit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: update Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « content/content_tests.gypi ('k') | content/test/webkit_support.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/public/common/content_client.h" 5 #include "content/public/common/content_client.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_piece.h" 8 #include "base/strings/string_piece.h"
9 #include "ui/gfx/image/image.h" 9 #include "ui/gfx/image/image.h"
10 #include "webkit/common/user_agent/user_agent.h" 10 #include "webkit/common/user_agent/user_agent.h"
(...skipping 22 matching lines...) Expand all
33 return rv; 33 return rv;
34 } 34 }
35 }; 35 };
36 36
37 void SetContentClient(ContentClient* client) { 37 void SetContentClient(ContentClient* client) {
38 g_client = client; 38 g_client = client;
39 39
40 // Set the default user agent as provided by the client. We need to make 40 // Set the default user agent as provided by the client. We need to make
41 // sure this is done before webkit_glue::GetUserAgent() is called (so that 41 // sure this is done before webkit_glue::GetUserAgent() is called (so that
42 // the UA doesn't change). 42 // the UA doesn't change).
43 if (client) { 43 if (client)
44 webkit_glue::SetUserAgent(client->GetUserAgent(), false); 44 webkit_glue::SetUserAgent(client->GetUserAgent());
45 }
46 } 45 }
47 46
48 ContentClient* GetContentClient() { 47 ContentClient* GetContentClient() {
49 return g_client; 48 return g_client;
50 } 49 }
51 50
52 ContentBrowserClient* SetBrowserClientForTesting(ContentBrowserClient* b) { 51 ContentBrowserClient* SetBrowserClientForTesting(ContentBrowserClient* b) {
53 return InternalTestInitializer::SetBrowser(b); 52 return InternalTestInitializer::SetBrowser(b);
54 } 53 }
55 54
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 int* sandbox_profile_resource_id) const { 119 int* sandbox_profile_resource_id) const {
121 return false; 120 return false;
122 } 121 }
123 122
124 std::string ContentClient::GetCarbonInterposePath() const { 123 std::string ContentClient::GetCarbonInterposePath() const {
125 return std::string(); 124 return std::string();
126 } 125 }
127 #endif 126 #endif
128 127
129 } // namespace content 128 } // namespace content
OLDNEW
« no previous file with comments | « content/content_tests.gypi ('k') | content/test/webkit_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698