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

Side by Side Diff: chrome/browser/web_resource/web_resource_service.cc

Issue 327793005: Change google_util::AppendGoogleLocaleParam to take in the application locale (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ChromeOS fix Created 6 years, 6 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 | « chrome/browser/ui/webui/sync_setup_handler.cc ('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 (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 "chrome/browser/web_resource/web_resource_service.h" 5 #include "chrome/browser/web_resource/web_resource_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 base::DoubleToString(base::Time::Now().ToDoubleT())); 112 base::DoubleToString(base::Time::Now().ToDoubleT()));
113 113
114 // If we are still fetching data, exit. 114 // If we are still fetching data, exit.
115 if (in_fetch_) 115 if (in_fetch_)
116 return; 116 return;
117 in_fetch_ = true; 117 in_fetch_ = true;
118 118
119 // Balanced in OnURLFetchComplete. 119 // Balanced in OnURLFetchComplete.
120 AddRef(); 120 AddRef();
121 121
122 GURL web_resource_server = apply_locale_to_url_ ? 122 GURL web_resource_server =
123 google_util::AppendGoogleLocaleParam(web_resource_server_) : 123 apply_locale_to_url_
124 web_resource_server_; 124 ? google_util::AppendGoogleLocaleParam(
125 web_resource_server_, g_browser_process->GetApplicationLocale())
126 : web_resource_server_;
125 127
126 DVLOG(1) << "WebResourceService StartFetch " << web_resource_server; 128 DVLOG(1) << "WebResourceService StartFetch " << web_resource_server;
127 url_fetcher_.reset(net::URLFetcher::Create( 129 url_fetcher_.reset(net::URLFetcher::Create(
128 web_resource_server, net::URLFetcher::GET, this)); 130 web_resource_server, net::URLFetcher::GET, this));
129 // Do not let url fetcher affect existing state in system context 131 // Do not let url fetcher affect existing state in system context
130 // (by setting cookies, for example). 132 // (by setting cookies, for example).
131 url_fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE | 133 url_fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE |
132 net::LOAD_DO_NOT_SEND_COOKIES | 134 net::LOAD_DO_NOT_SEND_COOKIES |
133 net::LOAD_DO_NOT_SAVE_COOKIES); 135 net::LOAD_DO_NOT_SAVE_COOKIES);
134 net::URLRequestContextGetter* url_request_context_getter = 136 net::URLRequestContextGetter* url_request_context_getter =
(...skipping 15 matching lines...) Expand all
150 json_unpacker_->Start(data); 152 json_unpacker_->Start(data);
151 } else { 153 } else {
152 // Don't parse data if attempt to download was unsuccessful. 154 // Don't parse data if attempt to download was unsuccessful.
153 // Stop loading new web resource data, and silently exit. 155 // Stop loading new web resource data, and silently exit.
154 // We do not call UnpackerClient, so we need to call EndFetch ourselves. 156 // We do not call UnpackerClient, so we need to call EndFetch ourselves.
155 EndFetch(); 157 EndFetch();
156 } 158 }
157 159
158 Release(); 160 Release();
159 } 161 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/sync_setup_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698