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

Side by Side Diff: chrome/browser/translate/translate_script.cc

Issue 23715006: Translate: Don't use custom CSS and JavaScript loader on iOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « no previous file | 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/translate/translate_script.h" 5 #include "chrome/browser/translate/translate_script.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 translate_script_url = GURL(kScriptURL); 81 translate_script_url = GURL(kScriptURL);
82 82
83 translate_script_url = net::AppendQueryParameter( 83 translate_script_url = net::AppendQueryParameter(
84 translate_script_url, 84 translate_script_url,
85 kCallbackQueryName, 85 kCallbackQueryName,
86 kCallbackQueryValue); 86 kCallbackQueryValue);
87 translate_script_url = net::AppendQueryParameter( 87 translate_script_url = net::AppendQueryParameter(
88 translate_script_url, 88 translate_script_url,
89 kAlwaysUseSslQueryName, 89 kAlwaysUseSslQueryName,
90 kAlwaysUseSslQueryValue); 90 kAlwaysUseSslQueryValue);
91 #if !defined(OS_IOS)
92 // iOS doesn't need to use specific loaders for the isolated world.
91 translate_script_url = net::AppendQueryParameter( 93 translate_script_url = net::AppendQueryParameter(
92 translate_script_url, 94 translate_script_url,
93 kCssLoaderCallbackQueryName, 95 kCssLoaderCallbackQueryName,
94 kCssLoaderCallbackQueryValue); 96 kCssLoaderCallbackQueryValue);
95 translate_script_url = net::AppendQueryParameter( 97 translate_script_url = net::AppendQueryParameter(
96 translate_script_url, 98 translate_script_url,
97 kJavascriptLoaderCallbackQueryName, 99 kJavascriptLoaderCallbackQueryName,
98 kJavascriptLoaderCallbackQueryValue); 100 kJavascriptLoaderCallbackQueryValue);
101 #endif // !defined(OS_IOS)
99 102
100 translate_script_url = 103 translate_script_url =
101 TranslateURLUtil::AddHostLocaleToUrl(translate_script_url); 104 TranslateURLUtil::AddHostLocaleToUrl(translate_script_url);
102 translate_script_url = 105 translate_script_url =
103 TranslateURLUtil::AddApiKeyToUrl(translate_script_url); 106 TranslateURLUtil::AddApiKeyToUrl(translate_script_url);
104 107
105 fetcher_.reset(new TranslateURLFetcher(kFetcherId)); 108 fetcher_.reset(new TranslateURLFetcher(kFetcherId));
106 fetcher_->set_extra_request_header(kRequestHeader); 109 fetcher_->set_extra_request_header(kRequestHeader);
107 fetcher_->Request( 110 fetcher_->Request(
108 translate_script_url, 111 translate_script_url,
(...skipping 29 matching lines...) Expand all
138 // scripts. 141 // scripts.
139 base::MessageLoop::current()->PostDelayedTask( 142 base::MessageLoop::current()->PostDelayedTask(
140 FROM_HERE, 143 FROM_HERE,
141 base::Bind(&TranslateScript::Clear, 144 base::Bind(&TranslateScript::Clear,
142 weak_method_factory_.GetWeakPtr()), 145 weak_method_factory_.GetWeakPtr()),
143 expiration_delay_); 146 expiration_delay_);
144 } 147 }
145 148
146 callback_.Run(success, data); 149 callback_.Run(success, data);
147 } 150 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698