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

Side by Side Diff: chrome/browser/ui/webui/ntp/suggestions_source_discovery.cc

Issue 10386063: Move URLFetcherDelegate to net/ and split URLFetcher between net/ and content/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync to head, fix win component build 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/ui/webui/ntp/suggestions_source_discovery.h" 5 #include "chrome/browser/ui/webui/ntp/suggestions_source_discovery.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 net::LOAD_DO_NOT_SAVE_COOKIES); 75 net::LOAD_DO_NOT_SAVE_COOKIES);
76 recommended_fetcher_->Start(); 76 recommended_fetcher_->Start();
77 } 77 }
78 78
79 void SuggestionsSourceDiscovery::SetCombiner(SuggestionsCombiner* combiner) { 79 void SuggestionsSourceDiscovery::SetCombiner(SuggestionsCombiner* combiner) {
80 DCHECK(!combiner_); 80 DCHECK(!combiner_);
81 combiner_ = combiner; 81 combiner_ = combiner;
82 } 82 }
83 83
84 void SuggestionsSourceDiscovery::OnURLFetchComplete( 84 void SuggestionsSourceDiscovery::OnURLFetchComplete(
85 const content::URLFetcher* source) { 85 const net::URLFetcher* source) {
86 DCHECK(combiner_); 86 DCHECK(combiner_);
87 STLDeleteElements(&items_); 87 STLDeleteElements(&items_);
88 if (source->GetStatus().status() == net::URLRequestStatus::SUCCESS && 88 if (source->GetStatus().status() == net::URLRequestStatus::SUCCESS &&
89 source->GetResponseCode() == net::HTTP_OK) { 89 source->GetResponseCode() == net::HTTP_OK) {
90 std::string data; 90 std::string data;
91 source->GetResponseAsString(&data); 91 source->GetResponseAsString(&data);
92 scoped_ptr<Value> message_value(base::JSONReader::Read(data, false)); 92 scoped_ptr<Value> message_value(base::JSONReader::Read(data, false));
93 93
94 DictionaryValue* response_dict; 94 DictionaryValue* response_dict;
95 DictionaryValue* response_data; 95 DictionaryValue* response_data;
(...skipping 16 matching lines...) Expand all
112 unescaped_url, 112 unescaped_url,
113 GURL(unescaped_url)); 113 GURL(unescaped_url));
114 items_.push_back(page_value); 114 items_.push_back(page_value);
115 } 115 }
116 } 116 }
117 } 117 }
118 118
119 recommended_fetcher_.reset(); 119 recommended_fetcher_.reset();
120 combiner_->OnItemsReady(); 120 combiner_->OnItemsReady();
121 } 121 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/suggestions_source_discovery.h ('k') | chrome/browser/web_resource/web_resource_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698