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

Side by Side Diff: chrome/browser/search/local_ntp_source.cc

Issue 14039004: Add int params to URLDataSource::StartDataRequest(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: It's not called a renderder. Created 7 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 | « chrome/browser/search/local_ntp_source.h ('k') | chrome/browser/ui/webui/about_ui.h » ('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 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/search/local_ntp_source.h" 5 #include "chrome/browser/search/local_ntp_source.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ref_counted_memory.h" 8 #include "base/memory/ref_counted_memory.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 LocalNtpSource::~LocalNtpSource() { 57 LocalNtpSource::~LocalNtpSource() {
58 } 58 }
59 59
60 std::string LocalNtpSource::GetSource() const { 60 std::string LocalNtpSource::GetSource() const {
61 return chrome::kChromeSearchLocalNtpHost; 61 return chrome::kChromeSearchLocalNtpHost;
62 } 62 }
63 63
64 void LocalNtpSource::StartDataRequest( 64 void LocalNtpSource::StartDataRequest(
65 const std::string& path, 65 const std::string& path,
66 bool is_incognito, 66 int render_process_id,
67 int render_view_id,
67 const content::URLDataSource::GotDataCallback& callback) { 68 const content::URLDataSource::GotDataCallback& callback) {
68 const std::string stripped_path = StripParameters(path); 69 const std::string stripped_path = StripParameters(path);
69 for (size_t i = 0; i < arraysize(kResources); ++i) { 70 for (size_t i = 0; i < arraysize(kResources); ++i) {
70 if (stripped_path == kResources[i].filename) { 71 if (stripped_path == kResources[i].filename) {
71 scoped_refptr<base::RefCountedStaticMemory> response( 72 scoped_refptr<base::RefCountedStaticMemory> response(
72 ResourceBundle::GetSharedInstance().LoadDataResourceBytes( 73 ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
73 kResources[i].identifier)); 74 kResources[i].identifier));
74 callback.Run(response); 75 callback.Run(response);
75 return; 76 return;
76 } 77 }
(...skipping 18 matching lines...) Expand all
95 if (request->url().SchemeIs(chrome::kChromeSearchScheme)) { 96 if (request->url().SchemeIs(chrome::kChromeSearchScheme)) {
96 DCHECK(StartsWithASCII(request->url().path(), "/", true)); 97 DCHECK(StartsWithASCII(request->url().path(), "/", true));
97 std::string filename = request->url().path().substr(1); 98 std::string filename = request->url().path().substr(1);
98 for (size_t i = 0; i < arraysize(kResources); ++i) { 99 for (size_t i = 0; i < arraysize(kResources); ++i) {
99 if (filename == kResources[i].filename) 100 if (filename == kResources[i].filename)
100 return true; 101 return true;
101 } 102 }
102 } 103 }
103 return false; 104 return false;
104 } 105 }
OLDNEW
« no previous file with comments | « chrome/browser/search/local_ntp_source.h ('k') | chrome/browser/ui/webui/about_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698