| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/browser/renderer_host/render_view_host.h" | 5 #include "chrome/browser/renderer_host/render_view_host.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/gfx/native_widget_types.h" | 10 #include "base/gfx/native_widget_types.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/renderer_host/render_view_host_delegate.h" | 21 #include "chrome/browser/renderer_host/render_view_host_delegate.h" |
| 22 #include "chrome/browser/renderer_host/render_widget_host.h" | 22 #include "chrome/browser/renderer_host/render_widget_host.h" |
| 23 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 23 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 24 #include "chrome/browser/tab_contents/navigation_entry.h" | 24 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 25 #include "chrome/browser/tab_contents/site_instance.h" | 25 #include "chrome/browser/tab_contents/site_instance.h" |
| 26 #include "chrome/browser/tab_contents/web_contents.h" | 26 #include "chrome/browser/tab_contents/web_contents.h" |
| 27 #include "chrome/common/render_messages.h" | 27 #include "chrome/common/render_messages.h" |
| 28 #include "chrome/common/resource_bundle.h" | 28 #include "chrome/common/resource_bundle.h" |
| 29 #include "chrome/common/notification_service.h" | 29 #include "chrome/common/notification_service.h" |
| 30 #include "chrome/common/notification_type.h" | 30 #include "chrome/common/notification_type.h" |
| 31 #include "chrome/common/url_constants.h" |
| 31 #include "chrome/common/thumbnail_score.h" | 32 #include "chrome/common/thumbnail_score.h" |
| 32 #include "net/base/net_util.h" | 33 #include "net/base/net_util.h" |
| 33 #include "skia/include/SkBitmap.h" | 34 #include "skia/include/SkBitmap.h" |
| 34 #include "webkit/glue/autofill_form.h" | 35 #include "webkit/glue/autofill_form.h" |
| 35 | 36 |
| 36 using base::TimeDelta; | 37 using base::TimeDelta; |
| 37 | 38 |
| 38 namespace { | 39 namespace { |
| 39 | 40 |
| 40 void FilterURL(RendererSecurityPolicy* policy, int renderer_id, GURL* url) { | 41 void FilterURL(RendererSecurityPolicy* policy, int renderer_id, GURL* url) { |
| 41 if (!url->is_valid()) | 42 if (!url->is_valid()) |
| 42 return; // We don't need to block invalid URLs. | 43 return; // We don't need to block invalid URLs. |
| 43 | 44 |
| 44 if (url->SchemeIs("about")) { | 45 if (url->SchemeIs(chrome::kAboutScheme)) { |
| 45 // The renderer treats all URLs in the about: scheme as being about:blank. | 46 // The renderer treats all URLs in the about: scheme as being about:blank. |
| 46 // Canonicalize about: URLs to about:blank. | 47 // Canonicalize about: URLs to about:blank. |
| 47 *url = GURL("about:blank"); | 48 *url = GURL(chrome::kAboutBlankURL); |
| 48 } | 49 } |
| 49 | 50 |
| 50 if (!policy->CanRequestURL(renderer_id, *url)) { | 51 if (!policy->CanRequestURL(renderer_id, *url)) { |
| 51 // If this renderer is not permitted to request this URL, we invalidate the | 52 // If this renderer is not permitted to request this URL, we invalidate the |
| 52 // URL. This prevents us from storing the blocked URL and becoming confused | 53 // URL. This prevents us from storing the blocked URL and becoming confused |
| 53 // later. | 54 // later. |
| 54 LOG(INFO) << "Blocked URL " << url->spec(); | 55 LOG(INFO) << "Blocked URL " << url->spec(); |
| 55 *url = GURL(); | 56 *url = GURL(); |
| 56 } | 57 } |
| 57 } | 58 } |
| (...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1294 std::string event_arg) { | 1295 std::string event_arg) { |
| 1295 Send(new ViewMsg_PersonalizationEvent(routing_id(), event_name, event_arg)); | 1296 Send(new ViewMsg_PersonalizationEvent(routing_id(), event_name, event_arg)); |
| 1296 } | 1297 } |
| 1297 #endif | 1298 #endif |
| 1298 | 1299 |
| 1299 void RenderViewHost::ForwardMessageFromExternalHost( | 1300 void RenderViewHost::ForwardMessageFromExternalHost( |
| 1300 const std::string& target, const std::string& message) { | 1301 const std::string& target, const std::string& message) { |
| 1301 Send(new ViewMsg_HandleMessageFromExternalHost(routing_id(), target, | 1302 Send(new ViewMsg_HandleMessageFromExternalHost(routing_id(), target, |
| 1302 message)); | 1303 message)); |
| 1303 } | 1304 } |
| OLD | NEW |