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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 2646133003: Retrieve NTP thumbnail URLs from the right frame (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | chrome/renderer/chrome_content_renderer_client_browsertest.cc » ('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 (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/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 if (ChromeExtensionsRendererClient::GetInstance()->WillSendRequest( 1146 if (ChromeExtensionsRendererClient::GetInstance()->WillSendRequest(
1147 frame, transition_type, url, new_url)) { 1147 frame, transition_type, url, new_url)) {
1148 return true; 1148 return true;
1149 } 1149 }
1150 #endif 1150 #endif
1151 1151
1152 if (!url.protocolIs(chrome::kChromeSearchScheme)) 1152 if (!url.protocolIs(chrome::kChromeSearchScheme))
1153 return false; 1153 return false;
1154 1154
1155 SearchBox* search_box = 1155 SearchBox* search_box =
1156 SearchBox::Get(content::RenderFrame::FromWebFrame(frame)); 1156 SearchBox::Get(content::RenderFrame::FromWebFrame(frame->localRoot()));
1157 if (search_box) { 1157 if (search_box) {
1158 // Note: this GURL copy could be avoided if host() were added to WebURL. 1158 // Note: this GURL copy could be avoided if host() were added to WebURL.
1159 GURL gurl(url); 1159 GURL gurl(url);
1160 SearchBox::ImageSourceType type = SearchBox::NONE; 1160 SearchBox::ImageSourceType type = SearchBox::NONE;
1161 if (gurl.host_piece() == chrome::kChromeUIFaviconHost) 1161 if (gurl.host_piece() == chrome::kChromeUIFaviconHost)
1162 type = SearchBox::FAVICON; 1162 type = SearchBox::FAVICON;
1163 else if (gurl.host_piece() == chrome::kChromeUILargeIconHost) 1163 else if (gurl.host_piece() == chrome::kChromeUILargeIconHost)
1164 type = SearchBox::LARGE_ICON; 1164 type = SearchBox::LARGE_ICON;
1165 else if (gurl.host_piece() == chrome::kChromeUIFallbackIconHost) 1165 else if (gurl.host_piece() == chrome::kChromeUIFallbackIconHost)
1166 type = SearchBox::FALLBACK_ICON; 1166 type = SearchBox::FALLBACK_ICON;
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
1510 std::vector<base::SchedulerWorkerPoolParams>* params_vector, 1510 std::vector<base::SchedulerWorkerPoolParams>* params_vector,
1511 base::TaskScheduler::WorkerPoolIndexForTraitsCallback* 1511 base::TaskScheduler::WorkerPoolIndexForTraitsCallback*
1512 index_to_traits_callback) { 1512 index_to_traits_callback) {
1513 DCHECK(params_vector); 1513 DCHECK(params_vector);
1514 DCHECK(index_to_traits_callback); 1514 DCHECK(index_to_traits_callback);
1515 // If this call fails, content will fall back to the default params. 1515 // If this call fails, content will fall back to the default params.
1516 *params_vector = task_scheduler_util::GetRendererWorkerPoolParams(); 1516 *params_vector = task_scheduler_util::GetRendererWorkerPoolParams();
1517 *index_to_traits_callback = 1517 *index_to_traits_callback =
1518 base::Bind(&task_scheduler_util::RendererWorkerPoolIndexForTraits); 1518 base::Bind(&task_scheduler_util::RendererWorkerPoolIndexForTraits);
1519 } 1519 }
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/chrome_content_renderer_client_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698