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

Side by Side Diff: chrome/browser/intents/cws_intents_registry.cc

Issue 10412050: Change most content::URLFetcher references to net::URLFetcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ChromeOS, address comments Created 8 years, 7 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
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/intents/cws_intents_registry.h" 5 #include "chrome/browser/intents/cws_intents_registry.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/json/json_string_value_serializer.h" 8 #include "base/json/json_string_value_serializer.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 14 matching lines...) Expand all
25 "https://www.googleapis.com/chromewebstore/v1.1b/items/intent"; 25 "https://www.googleapis.com/chromewebstore/v1.1b/items/intent";
26 26
27 } // namespace 27 } // namespace
28 28
29 // Internal object representing all data associated with a single query. 29 // Internal object representing all data associated with a single query.
30 struct CWSIntentsRegistry::IntentsQuery { 30 struct CWSIntentsRegistry::IntentsQuery {
31 IntentsQuery(); 31 IntentsQuery();
32 ~IntentsQuery(); 32 ~IntentsQuery();
33 33
34 // Underlying URL request query. 34 // Underlying URL request query.
35 scoped_ptr<content::URLFetcher> url_fetcher; 35 scoped_ptr<net::URLFetcher> url_fetcher;
36 36
37 // The callback - invoked on completed retrieval. 37 // The callback - invoked on completed retrieval.
38 ResultsCallback callback; 38 ResultsCallback callback;
39 }; 39 };
40 40
41 CWSIntentsRegistry::IntentsQuery::IntentsQuery() { 41 CWSIntentsRegistry::IntentsQuery::IntentsQuery() {
42 } 42 }
43 43
44 CWSIntentsRegistry::IntentsQuery::~IntentsQuery() { 44 CWSIntentsRegistry::IntentsQuery::~IntentsQuery() {
45 } 45 }
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 if (!query->callback.is_null()) 135 if (!query->callback.is_null())
136 query->callback.Run(intents); 136 query->callback.Run(intents);
137 } 137 }
138 138
139 void CWSIntentsRegistry::GetIntentServices(const string16& action, 139 void CWSIntentsRegistry::GetIntentServices(const string16& action,
140 const string16& mimetype, 140 const string16& mimetype,
141 const ResultsCallback& cb) { 141 const ResultsCallback& cb) {
142 scoped_ptr<IntentsQuery> query(new IntentsQuery); 142 scoped_ptr<IntentsQuery> query(new IntentsQuery);
143 query->callback = cb; 143 query->callback = cb;
144 query->url_fetcher.reset(content::URLFetcher::Create( 144 query->url_fetcher.reset(content::URLFetcher::Create(
145 0, BuildQueryURL(action,mimetype), content::URLFetcher::GET, this)); 145 0, BuildQueryURL(action,mimetype), net::URLFetcher::GET, this));
146 146
147 if (query->url_fetcher.get() == NULL) 147 if (query->url_fetcher.get() == NULL)
148 return; 148 return;
149 149
150 query->url_fetcher->SetRequestContext(request_context_); 150 query->url_fetcher->SetRequestContext(request_context_);
151 query->url_fetcher->SetLoadFlags( 151 query->url_fetcher->SetLoadFlags(
152 net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES); 152 net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES);
153 153
154 URLFetcherHandle handle = reinterpret_cast<URLFetcherHandle>( 154 URLFetcherHandle handle = reinterpret_cast<URLFetcherHandle>(
155 query->url_fetcher.get()); 155 query->url_fetcher.get());
156 queries_[handle] = query.release(); 156 queries_[handle] = query.release();
157 queries_[handle]->url_fetcher->Start(); 157 queries_[handle]->url_fetcher->Start();
158 } 158 }
159 159
160 // static 160 // static
161 GURL CWSIntentsRegistry::BuildQueryURL(const string16& action, 161 GURL CWSIntentsRegistry::BuildQueryURL(const string16& action,
162 const string16& type) { 162 const string16& type) {
163 GURL request(kCWSIntentServiceURL); 163 GURL request(kCWSIntentServiceURL);
164 request = chrome_common_net::AppendQueryParameter(request, "intent", 164 request = chrome_common_net::AppendQueryParameter(request, "intent",
165 UTF16ToUTF8(action)); 165 UTF16ToUTF8(action));
166 request = chrome_common_net::AppendQueryParameter(request, "mime_types", 166 request = chrome_common_net::AppendQueryParameter(request, "mime_types",
167 UTF16ToUTF8(type)); 167 UTF16ToUTF8(type));
168 if (web_intents::kApiKey[0]) { 168 if (web_intents::kApiKey[0]) {
169 request = chrome_common_net::AppendQueryParameter(request, "key", 169 request = chrome_common_net::AppendQueryParameter(request, "key",
170 web_intents::kApiKey); 170 web_intents::kApiKey);
171 } 171 }
172 172
173 return request; 173 return request;
174 } 174 }
OLDNEW
« no previous file with comments | « chrome/browser/importer/toolbar_importer.cc ('k') | chrome/browser/intranet_redirect_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698