| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_view.h" | 5 #include "content/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 4087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4098 // Must be a top level frame. | 4098 // Must be a top level frame. |
| 4099 if (frame->parent() != NULL) | 4099 if (frame->parent() != NULL) |
| 4100 return false; | 4100 return false; |
| 4101 | 4101 |
| 4102 // Navigations initiated within Webkit are not sent out to the external host | 4102 // Navigations initiated within Webkit are not sent out to the external host |
| 4103 // in the following cases. | 4103 // in the following cases. |
| 4104 // 1. The url scheme is not http/https | 4104 // 1. The url scheme is not http/https |
| 4105 // 2. The origin of the url and the opener is the same in which case the | 4105 // 2. The origin of the url and the opener is the same in which case the |
| 4106 // opener relationship is maintained. | 4106 // opener relationship is maintained. |
| 4107 // 3. Reloads/form submits/back forward navigations | 4107 // 3. Reloads/form submits/back forward navigations |
| 4108 if (!url.SchemeIs("http") && !url.SchemeIs("https")) | 4108 if (!url.SchemeIs(chrome::kHttpScheme) && !url.SchemeIs(chrome::kHttpsScheme)) |
| 4109 return false; | 4109 return false; |
| 4110 | 4110 |
| 4111 // Not interested in reloads/form submits/resubmits/back forward navigations. | 4111 // Not interested in reloads/form submits/resubmits/back forward navigations. |
| 4112 if (type != WebKit::WebNavigationTypeReload && | 4112 if (type != WebKit::WebNavigationTypeReload && |
| 4113 type != WebKit::WebNavigationTypeFormSubmitted && | 4113 type != WebKit::WebNavigationTypeFormSubmitted && |
| 4114 type != WebKit::WebNavigationTypeFormResubmitted && | 4114 type != WebKit::WebNavigationTypeFormResubmitted && |
| 4115 type != WebKit::WebNavigationTypeBackForward) { | 4115 type != WebKit::WebNavigationTypeBackForward) { |
| 4116 // The opener relationship between the new window and the parent allows the | 4116 // The opener relationship between the new window and the parent allows the |
| 4117 // new window to script the parent and vice versa. This is not allowed if | 4117 // new window to script the parent and vice versa. This is not allowed if |
| 4118 // the origins of the two domains are different. This can be treated as a | 4118 // the origins of the two domains are different. This can be treated as a |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4179 const webkit_glue::CustomContextMenuContext& custom_context) { | 4179 const webkit_glue::CustomContextMenuContext& custom_context) { |
| 4180 if (custom_context.is_pepper_menu) | 4180 if (custom_context.is_pepper_menu) |
| 4181 pepper_delegate_.OnContextMenuClosed(custom_context); | 4181 pepper_delegate_.OnContextMenuClosed(custom_context); |
| 4182 else | 4182 else |
| 4183 context_menu_node_.reset(); | 4183 context_menu_node_.reset(); |
| 4184 } | 4184 } |
| 4185 | 4185 |
| 4186 void RenderView::OnNetworkStateChanged(bool online) { | 4186 void RenderView::OnNetworkStateChanged(bool online) { |
| 4187 WebNetworkStateNotifier::setOnLine(online); | 4187 WebNetworkStateNotifier::setOnLine(online); |
| 4188 } | 4188 } |
| OLD | NEW |