OLD | NEW |
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 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 return true; | 1379 return true; |
1380 } | 1380 } |
1381 #endif | 1381 #endif |
1382 | 1382 |
1383 const content::RenderView* render_view = | 1383 const content::RenderView* render_view = |
1384 content::RenderView::FromWebView(frame->view()); | 1384 content::RenderView::FromWebView(frame->view()); |
1385 SearchBox* search_box = SearchBox::Get(render_view); | 1385 SearchBox* search_box = SearchBox::Get(render_view); |
1386 if (search_box && url.SchemeIs(chrome::kChromeSearchScheme)) { | 1386 if (search_box && url.SchemeIs(chrome::kChromeSearchScheme)) { |
1387 if (url.host() == chrome::kChromeUIThumbnailHost) | 1387 if (url.host() == chrome::kChromeUIThumbnailHost) |
1388 return search_box->GenerateThumbnailURLFromTransientURL(url, new_url); | 1388 return search_box->GenerateThumbnailURLFromTransientURL(url, new_url); |
1389 else if (url.host() == chrome::kChromeUIFaviconHost) | 1389 if (url.host() == chrome::kChromeUIFaviconHost) |
1390 return search_box->GenerateFaviconURLFromTransientURL(url, new_url); | 1390 return search_box->GenerateFaviconURLFromTransientURL(url, new_url); |
| 1391 if (url.host() == chrome::kChromeUIFallbackIconHost) |
| 1392 return search_box->GenerateFallbackIconURLFromTransientURL(url, new_url); |
| 1393 |
| 1394 // More restrictions for big icon host, since it may return 404 and we |
| 1395 // don't want search providers to use this as signal |
| 1396 if (url.host() == chrome::kChromeUIBigIconHost) |
| 1397 return search_box->GenerateBigIconURLFromTransientURL(url, new_url); |
1391 } | 1398 } |
1392 | 1399 |
1393 return false; | 1400 return false; |
1394 } | 1401 } |
1395 | 1402 |
1396 void ChromeContentRendererClient::DidCreateScriptContext( | 1403 void ChromeContentRendererClient::DidCreateScriptContext( |
1397 blink::WebLocalFrame* frame, | 1404 blink::WebLocalFrame* frame, |
1398 v8::Handle<v8::Context> context, | 1405 v8::Handle<v8::Context> context, |
1399 int extension_group, | 1406 int extension_group, |
1400 int world_id) { | 1407 int world_id) { |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 if (mime_type == content::kBrowserPluginMimeType) { | 1665 if (mime_type == content::kBrowserPluginMimeType) { |
1659 return new extensions::ExtensionsGuestViewContainer(render_frame); | 1666 return new extensions::ExtensionsGuestViewContainer(render_frame); |
1660 } else { | 1667 } else { |
1661 return new extensions::MimeHandlerViewContainer( | 1668 return new extensions::MimeHandlerViewContainer( |
1662 render_frame, mime_type, original_url); | 1669 render_frame, mime_type, original_url); |
1663 } | 1670 } |
1664 #else | 1671 #else |
1665 return NULL; | 1672 return NULL; |
1666 #endif | 1673 #endif |
1667 } | 1674 } |
OLD | NEW |