| 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 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1371 frame)) { | 1371 frame)) { |
| 1372 *new_url = GURL(chrome::kExtensionResourceInvalidRequestURL); | 1372 *new_url = GURL(chrome::kExtensionResourceInvalidRequestURL); |
| 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 SearchBox::ImageSourceType type = SearchBox::NONE; |
| 1382 return search_box->GenerateThumbnailURLFromTransientURL(url, new_url); | 1382 if (url.host() == chrome::kChromeUIFaviconHost) |
| 1383 else if (url.host() == chrome::kChromeUIFaviconHost) | 1383 type = SearchBox::FAVICON; |
| 1384 return search_box->GenerateFaviconURLFromTransientURL(url, new_url); | 1384 else if (url.host() == chrome::kChromeUILargeIconHost) |
| 1385 type = SearchBox::LARGE_ICON; |
| 1386 else if (url.host() == chrome::kChromeUIFallbackIconHost) |
| 1387 type = SearchBox::FALLBACK_ICON; |
| 1388 else if (url.host() == chrome::kChromeUIThumbnailHost) |
| 1389 type = SearchBox::THUMB; |
| 1390 if (type != SearchBox::NONE) |
| 1391 return search_box->GenerateImageURLFromTransientURL(url, type, new_url); |
| 1385 } | 1392 } |
| 1386 | 1393 |
| 1387 return false; | 1394 return false; |
| 1388 } | 1395 } |
| 1389 | 1396 |
| 1390 void ChromeContentRendererClient::DidCreateScriptContext( | 1397 void ChromeContentRendererClient::DidCreateScriptContext( |
| 1391 blink::WebLocalFrame* frame, | 1398 blink::WebLocalFrame* frame, |
| 1392 v8::Handle<v8::Context> context, | 1399 v8::Handle<v8::Context> context, |
| 1393 int extension_group, | 1400 int extension_group, |
| 1394 int world_id) { | 1401 int world_id) { |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1652 if (mime_type == content::kBrowserPluginMimeType) { | 1659 if (mime_type == content::kBrowserPluginMimeType) { |
| 1653 return new extensions::ExtensionsGuestViewContainer(render_frame); | 1660 return new extensions::ExtensionsGuestViewContainer(render_frame); |
| 1654 } else { | 1661 } else { |
| 1655 return new extensions::MimeHandlerViewContainer( | 1662 return new extensions::MimeHandlerViewContainer( |
| 1656 render_frame, mime_type, original_url); | 1663 render_frame, mime_type, original_url); |
| 1657 } | 1664 } |
| 1658 #else | 1665 #else |
| 1659 return NULL; | 1666 return NULL; |
| 1660 #endif | 1667 #endif |
| 1661 } | 1668 } |
| OLD | NEW |