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

Side by Side Diff: android_webview/common/aw_content_client.cc

Issue 239993009: Revert accidental dartium code push (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | « OWNERS ('k') | build/all.gyp » ('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 "android_webview/common/aw_content_client.h" 5 #include "android_webview/common/aw_content_client.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "content/public/common/content_switches.h" 9 #include "content/public/common/content_switches.h"
10 #include "content/public/common/user_agent.h" 10 #include "content/public/common/user_agent.h"
11 #include "ipc/ipc_message.h" 11 #include "ipc/ipc_message.h"
12 #include "ui/base/l10n/l10n_util.h" 12 #include "ui/base/l10n/l10n_util.h"
13 #include "ui/base/resource/resource_bundle.h" 13 #include "ui/base/resource/resource_bundle.h"
14 14
15 namespace { 15 namespace {
16 16
17 std::string GetProduct() { 17 std::string GetProduct() {
18 // "Chrome/XX.0.0.0" identifies that this WebView is derived from the 18 // "Chrome/XX.0.0.0" identifies that this WebView is derived from the
19 // corresponding Chromium version XX. 19 // corresponding Chromium version XX.
20 // TODO(torne): Use chrome/VERSION file. See http://crbug.com/297522 20 // TODO(torne): Use chrome/VERSION file. See http://crbug.com/297522
21 return "Chrome/33.0.0.0"; 21 return "Chrome/33.0.0.0";
22 } 22 }
23 23
24 } 24 }
25 25
26 namespace android_webview { 26 namespace android_webview {
27 27
28 std::string GetUserAgent() { 28 std::string GetUserAgent() {
29 // "Version/4.0" had been hardcoded in the legacy WebView. 29 // "Version/4.0" had been hardcoded in the legacy WebView.
30 std::string product = "Version/4.0 (Dart) " + GetProduct(); 30 std::string product = "Version/4.0 " + GetProduct();
31 if (CommandLine::ForCurrentProcess()->HasSwitch( 31 if (CommandLine::ForCurrentProcess()->HasSwitch(
32 switches::kUseMobileUserAgent)) { 32 switches::kUseMobileUserAgent)) {
33 product += " Mobile"; 33 product += " Mobile";
34 } 34 }
35 return content::BuildUserAgentFromProduct(product); 35 return content::BuildUserAgentFromProduct(product);
36 } 36 }
37 37
38 std::string AwContentClient::GetProduct() const { 38 std::string AwContentClient::GetProduct() const {
39 return ::GetProduct(); 39 return ::GetProduct();
40 } 40 }
(...skipping 19 matching lines...) Expand all
60 60
61 bool AwContentClient::CanSendWhileSwappedOut(const IPC::Message* message) { 61 bool AwContentClient::CanSendWhileSwappedOut(const IPC::Message* message) {
62 // For legacy API support we perform a few browser -> renderer synchronous IPC 62 // For legacy API support we perform a few browser -> renderer synchronous IPC
63 // messages that block the browser. However, the synchronous IPC replies might 63 // messages that block the browser. However, the synchronous IPC replies might
64 // be dropped by the renderer during a swap out, deadlocking the browser. 64 // be dropped by the renderer during a swap out, deadlocking the browser.
65 // Because of this we should never drop any synchronous IPC replies. 65 // Because of this we should never drop any synchronous IPC replies.
66 return message->type() == IPC_REPLY_ID; 66 return message->type() == IPC_REPLY_ID;
67 } 67 }
68 68
69 } // namespace android_webview 69 } // namespace android_webview
OLDNEW
« no previous file with comments | « OWNERS ('k') | build/all.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698