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 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1359 frame)) { | 1359 frame)) { |
1360 *new_url = GURL(chrome::kExtensionResourceInvalidRequestURL); | 1360 *new_url = GURL(chrome::kExtensionResourceInvalidRequestURL); |
1361 return true; | 1361 return true; |
1362 } | 1362 } |
1363 #endif | 1363 #endif |
1364 | 1364 |
1365 const content::RenderView* render_view = | 1365 const content::RenderView* render_view = |
1366 content::RenderView::FromWebView(frame->view()); | 1366 content::RenderView::FromWebView(frame->view()); |
1367 SearchBox* search_box = SearchBox::Get(render_view); | 1367 SearchBox* search_box = SearchBox::Get(render_view); |
1368 if (search_box && url.SchemeIs(chrome::kChromeSearchScheme)) { | 1368 if (search_box && url.SchemeIs(chrome::kChromeSearchScheme)) { |
1369 if (url.host() == chrome::kChromeUIThumbnailHost) | 1369 SearchBox::ImageSourceType type = SearchBox::NONE; |
1370 return search_box->GenerateThumbnailURLFromTransientURL(url, new_url); | 1370 if (url.host() == chrome::kChromeUIFaviconHost) |
1371 else if (url.host() == chrome::kChromeUIFaviconHost) | 1371 type = SearchBox::FAVICON; |
1372 return search_box->GenerateFaviconURLFromTransientURL(url, new_url); | 1372 else if (url.host() == chrome::kChromeUILargeIconHost) |
| 1373 type = SearchBox::LARGE_ICON; |
| 1374 else if (url.host() == chrome::kChromeUIFallbackIconHost) |
| 1375 type = SearchBox::FALLBACK_ICON; |
| 1376 else if (url.host() == chrome::kChromeUIThumbnailHost) |
| 1377 type = SearchBox::THUMB; |
| 1378 if (type != SearchBox::NONE) |
| 1379 return search_box->GenerateImageURLFromTransientURL(url, type, new_url); |
1373 } | 1380 } |
1374 | 1381 |
1375 return false; | 1382 return false; |
1376 } | 1383 } |
1377 | 1384 |
1378 void ChromeContentRendererClient::DidCreateScriptContext( | 1385 void ChromeContentRendererClient::DidCreateScriptContext( |
1379 blink::WebLocalFrame* frame, | 1386 blink::WebLocalFrame* frame, |
1380 v8::Handle<v8::Context> context, | 1387 v8::Handle<v8::Context> context, |
1381 int extension_group, | 1388 int extension_group, |
1382 int world_id) { | 1389 int world_id) { |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1640 if (mime_type == content::kBrowserPluginMimeType) { | 1647 if (mime_type == content::kBrowserPluginMimeType) { |
1641 return new extensions::ExtensionsGuestViewContainer(render_frame); | 1648 return new extensions::ExtensionsGuestViewContainer(render_frame); |
1642 } else { | 1649 } else { |
1643 return new extensions::MimeHandlerViewContainer( | 1650 return new extensions::MimeHandlerViewContainer( |
1644 render_frame, mime_type, original_url); | 1651 render_frame, mime_type, original_url); |
1645 } | 1652 } |
1646 #else | 1653 #else |
1647 return NULL; | 1654 return NULL; |
1648 #endif | 1655 #endif |
1649 } | 1656 } |
OLD | NEW |