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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 } | 608 } |
609 | 609 |
610 SkBitmap* ChromeContentRendererClient::GetSadWebViewBitmap() { | 610 SkBitmap* ChromeContentRendererClient::GetSadWebViewBitmap() { |
611 return const_cast<SkBitmap*>(ResourceBundle::GetSharedInstance(). | 611 return const_cast<SkBitmap*>(ResourceBundle::GetSharedInstance(). |
612 GetImageNamed(IDR_SAD_WEBVIEW).ToSkBitmap()); | 612 GetImageNamed(IDR_SAD_WEBVIEW).ToSkBitmap()); |
613 } | 613 } |
614 | 614 |
615 #if defined(ENABLE_EXTENSIONS) | 615 #if defined(ENABLE_EXTENSIONS) |
616 const Extension* ChromeContentRendererClient::GetExtensionByOrigin( | 616 const Extension* ChromeContentRendererClient::GetExtensionByOrigin( |
617 const WebSecurityOrigin& origin) const { | 617 const WebSecurityOrigin& origin) const { |
618 if (!EqualsASCII(origin.protocol(), extensions::kExtensionScheme)) | 618 if (!base::EqualsASCII(origin.protocol(), extensions::kExtensionScheme)) |
619 return NULL; | 619 return NULL; |
620 | 620 |
621 const std::string extension_id = origin.host().utf8().data(); | 621 const std::string extension_id = origin.host().utf8().data(); |
622 return extension_dispatcher_->extensions()->GetByID(extension_id); | 622 return extension_dispatcher_->extensions()->GetByID(extension_id); |
623 } | 623 } |
624 #endif | 624 #endif |
625 | 625 |
626 scoped_ptr<blink::WebPluginPlaceholder> | 626 scoped_ptr<blink::WebPluginPlaceholder> |
627 ChromeContentRendererClient::CreatePluginPlaceholder( | 627 ChromeContentRendererClient::CreatePluginPlaceholder( |
628 content::RenderFrame* render_frame, | 628 content::RenderFrame* render_frame, |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1148 const Extension* extension = NULL; | 1148 const Extension* extension = NULL; |
1149 | 1149 |
1150 #if defined(ENABLE_EXTENSIONS) | 1150 #if defined(ENABLE_EXTENSIONS) |
1151 if (failed_url.is_valid() && | 1151 if (failed_url.is_valid() && |
1152 !failed_url.SchemeIs(extensions::kExtensionScheme)) { | 1152 !failed_url.SchemeIs(extensions::kExtensionScheme)) { |
1153 extension = extension_dispatcher_->extensions()->GetExtensionOrAppByURL( | 1153 extension = extension_dispatcher_->extensions()->GetExtensionOrAppByURL( |
1154 failed_url); | 1154 failed_url); |
1155 } | 1155 } |
1156 #endif | 1156 #endif |
1157 | 1157 |
1158 bool is_post = EqualsASCII(failed_request.httpMethod(), "POST"); | 1158 bool is_post = base::EqualsASCII(failed_request.httpMethod(), "POST"); |
1159 | 1159 |
1160 if (error_html) { | 1160 if (error_html) { |
1161 bool extension_but_not_bookmark_app = false; | 1161 bool extension_but_not_bookmark_app = false; |
1162 #if defined(ENABLE_EXTENSIONS) | 1162 #if defined(ENABLE_EXTENSIONS) |
1163 extension_but_not_bookmark_app = extension && !extension->from_bookmark(); | 1163 extension_but_not_bookmark_app = extension && !extension->from_bookmark(); |
1164 #endif | 1164 #endif |
1165 // Use a local error page. | 1165 // Use a local error page. |
1166 if (extension_but_not_bookmark_app) { | 1166 if (extension_but_not_bookmark_app) { |
1167 #if defined(ENABLE_EXTENSIONS) | 1167 #if defined(ENABLE_EXTENSIONS) |
1168 // TODO(erikkay): Should we use a different template for different | 1168 // TODO(erikkay): Should we use a different template for different |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1648 WebString header_key(ASCIIToUTF16( | 1648 WebString header_key(ASCIIToUTF16( |
1649 data_reduction_proxy::chrome_proxy_header())); | 1649 data_reduction_proxy::chrome_proxy_header())); |
1650 if (!response.httpHeaderField(header_key).isNull() && | 1650 if (!response.httpHeaderField(header_key).isNull() && |
1651 response.httpHeaderField(header_key).utf8().find( | 1651 response.httpHeaderField(header_key).utf8().find( |
1652 data_reduction_proxy::chrome_proxy_lo_fi_directive()) != | 1652 data_reduction_proxy::chrome_proxy_lo_fi_directive()) != |
1653 std::string::npos) { | 1653 std::string::npos) { |
1654 (*properties)[data_reduction_proxy::chrome_proxy_header()] = | 1654 (*properties)[data_reduction_proxy::chrome_proxy_header()] = |
1655 data_reduction_proxy::chrome_proxy_lo_fi_directive(); | 1655 data_reduction_proxy::chrome_proxy_lo_fi_directive(); |
1656 } | 1656 } |
1657 } | 1657 } |
OLD | NEW |