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

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

Issue 1017853002: [Icons NTP] Allow chrome-search:// large-icon and fallback-icon hosts to use <view_id>/<restricted_… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/crash_logging.h" 8 #include "base/debug/crash_logging.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 return true; 1373 return true;
1374 } 1374 }
1375 #endif 1375 #endif
1376 1376
1377 const content::RenderView* render_view = 1377 const content::RenderView* render_view =
1378 content::RenderView::FromWebView(frame->view()); 1378 content::RenderView::FromWebView(frame->view());
1379 SearchBox* search_box = SearchBox::Get(render_view); 1379 SearchBox* search_box = SearchBox::Get(render_view);
1380 if (search_box && url.SchemeIs(chrome::kChromeSearchScheme)) { 1380 if (search_box && url.SchemeIs(chrome::kChromeSearchScheme)) {
1381 if (url.host() == chrome::kChromeUIThumbnailHost) 1381 if (url.host() == chrome::kChromeUIThumbnailHost)
1382 return search_box->GenerateThumbnailURLFromTransientURL(url, new_url); 1382 return search_box->GenerateThumbnailURLFromTransientURL(url, new_url);
1383 else if (url.host() == chrome::kChromeUIFaviconHost) 1383 if (url.host() == chrome::kChromeUIFaviconHost)
James Hawkins 2015/03/17 21:46:41 Shouldn't these all be else if since the hosts are
huangs 2015/03/18 21:43:10 I thought you don't need else if returning?
1384 return search_box->GenerateFaviconURLFromTransientURL(url, new_url); 1384 return search_box->GenerateFaviconURLFromTransientURL(url, new_url);
1385 if (url.host() == chrome::kChromeUILargeIconHost)
1386 return search_box->GenerateLargeIconURLFromTransientURL(url, new_url);
1387 if (url.host() == chrome::kChromeUIFallbackIconHost)
1388 return search_box->GenerateFallbackIconURLFromTransientURL(url, new_url);
1385 } 1389 }
1386 1390
1387 return false; 1391 return false;
1388 } 1392 }
1389 1393
1390 void ChromeContentRendererClient::DidCreateScriptContext( 1394 void ChromeContentRendererClient::DidCreateScriptContext(
1391 blink::WebLocalFrame* frame, 1395 blink::WebLocalFrame* frame,
1392 v8::Handle<v8::Context> context, 1396 v8::Handle<v8::Context> context,
1393 int extension_group, 1397 int extension_group,
1394 int world_id) { 1398 int world_id) {
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1652 if (mime_type == content::kBrowserPluginMimeType) { 1656 if (mime_type == content::kBrowserPluginMimeType) {
1653 return new extensions::ExtensionsGuestViewContainer(render_frame); 1657 return new extensions::ExtensionsGuestViewContainer(render_frame);
1654 } else { 1658 } else {
1655 return new extensions::MimeHandlerViewContainer( 1659 return new extensions::MimeHandlerViewContainer(
1656 render_frame, mime_type, original_url); 1660 render_frame, mime_type, original_url);
1657 } 1661 }
1658 #else 1662 #else
1659 return NULL; 1663 return NULL;
1660 #endif 1664 #endif
1661 } 1665 }
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/searchbox/searchbox.h » ('j') | chrome/renderer/searchbox/searchbox.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698