OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 #include "content/renderer/render_view_impl.h" | 63 #include "content/renderer/render_view_impl.h" |
64 #include "content/renderer/render_widget_fullscreen_pepper.h" | 64 #include "content/renderer/render_widget_fullscreen_pepper.h" |
65 #include "content/renderer/renderer_webapplicationcachehost_impl.h" | 65 #include "content/renderer/renderer_webapplicationcachehost_impl.h" |
66 #include "content/renderer/renderer_webcolorchooser_impl.h" | 66 #include "content/renderer/renderer_webcolorchooser_impl.h" |
67 #include "content/renderer/shared_worker_repository.h" | 67 #include "content/renderer/shared_worker_repository.h" |
68 #include "content/renderer/v8_value_converter_impl.h" | 68 #include "content/renderer/v8_value_converter_impl.h" |
69 #include "content/renderer/websharedworker_proxy.h" | 69 #include "content/renderer/websharedworker_proxy.h" |
70 #include "net/base/data_url.h" | 70 #include "net/base/data_url.h" |
71 #include "net/base/net_errors.h" | 71 #include "net/base/net_errors.h" |
72 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 72 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 73 #include "net/base/url_constants.h" |
73 #include "net/http/http_util.h" | 74 #include "net/http/http_util.h" |
74 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" | 75 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" |
75 #include "third_party/WebKit/public/platform/WebString.h" | 76 #include "third_party/WebKit/public/platform/WebString.h" |
76 #include "third_party/WebKit/public/platform/WebURL.h" | 77 #include "third_party/WebKit/public/platform/WebURL.h" |
77 #include "third_party/WebKit/public/platform/WebURLError.h" | 78 #include "third_party/WebKit/public/platform/WebURLError.h" |
78 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 79 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
79 #include "third_party/WebKit/public/platform/WebVector.h" | 80 #include "third_party/WebKit/public/platform/WebVector.h" |
80 #include "third_party/WebKit/public/web/WebColorSuggestion.h" | 81 #include "third_party/WebKit/public/web/WebColorSuggestion.h" |
81 #include "third_party/WebKit/public/web/WebDocument.h" | 82 #include "third_party/WebKit/public/web/WebDocument.h" |
82 #include "third_party/WebKit/public/web/WebGlyphCache.h" | 83 #include "third_party/WebKit/public/web/WebGlyphCache.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 bool is_form_post) { | 269 bool is_form_post) { |
269 if (!IsTopLevelNavigation(frame)) | 270 if (!IsTopLevelNavigation(frame)) |
270 return false; | 271 return false; |
271 | 272 |
272 // Navigations initiated within Webkit are not sent out to the external host | 273 // Navigations initiated within Webkit are not sent out to the external host |
273 // in the following cases. | 274 // in the following cases. |
274 // 1. The url scheme is not http/https | 275 // 1. The url scheme is not http/https |
275 // 2. The origin of the url and the opener is the same in which case the | 276 // 2. The origin of the url and the opener is the same in which case the |
276 // opener relationship is maintained. | 277 // opener relationship is maintained. |
277 // 3. Reloads/form submits/back forward navigations | 278 // 3. Reloads/form submits/back forward navigations |
278 if (!url.SchemeIs(kHttpScheme) && !url.SchemeIs(kHttpsScheme)) | 279 if (!url.SchemeIs(net::kHttpScheme) && !url.SchemeIs(net::kHttpsScheme)) |
279 return false; | 280 return false; |
280 | 281 |
281 if (type != blink::WebNavigationTypeReload && | 282 if (type != blink::WebNavigationTypeReload && |
282 type != blink::WebNavigationTypeBackForward && !is_form_post) { | 283 type != blink::WebNavigationTypeBackForward && !is_form_post) { |
283 // The opener relationship between the new window and the parent allows the | 284 // The opener relationship between the new window and the parent allows the |
284 // new window to script the parent and vice versa. This is not allowed if | 285 // new window to script the parent and vice versa. This is not allowed if |
285 // the origins of the two domains are different. This can be treated as a | 286 // the origins of the two domains are different. This can be treated as a |
286 // top level navigation and routed back to the host. | 287 // top level navigation and routed back to the host. |
287 blink::WebFrame* opener = frame->opener(); | 288 blink::WebFrame* opener = frame->opener(); |
288 if (!opener) | 289 if (!opener) |
(...skipping 2889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3178 selection_text_offset_ = offset; | 3179 selection_text_offset_ = offset; |
3179 selection_range_ = range; | 3180 selection_range_ = range; |
3180 // This IPC is dispatched by RenderWidetHost, so use its routing ID. | 3181 // This IPC is dispatched by RenderWidetHost, so use its routing ID. |
3181 Send(new ViewHostMsg_SelectionChanged( | 3182 Send(new ViewHostMsg_SelectionChanged( |
3182 GetRenderWidget()->routing_id(), text, offset, range)); | 3183 GetRenderWidget()->routing_id(), text, offset, range)); |
3183 } | 3184 } |
3184 GetRenderWidget()->UpdateSelectionBounds(); | 3185 GetRenderWidget()->UpdateSelectionBounds(); |
3185 } | 3186 } |
3186 | 3187 |
3187 } // namespace content | 3188 } // namespace content |
OLD | NEW |