| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 5219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5230 GURL frame_origin = GURL(frame->url()).GetOrigin(); | 5230 GURL frame_origin = GURL(frame->url()).GetOrigin(); |
| 5231 if (url.GetOrigin() != frame_origin || url.ref().empty()) { | 5231 if (url.GetOrigin() != frame_origin || url.ref().empty()) { |
| 5232 // The link click could stay on the same page, in cases where it sends some | 5232 // The link click could stay on the same page, in cases where it sends some |
| 5233 // parameters to the same URL. | 5233 // parameters to the same URL. |
| 5234 if (type == WebKit::WebNavigationTypeLinkClicked) | 5234 if (type == WebKit::WebNavigationTypeLinkClicked) |
| 5235 return true; | 5235 return true; |
| 5236 | 5236 |
| 5237 if (last_top_level_navigation_page_id_ != page_id_ && | 5237 if (last_top_level_navigation_page_id_ != page_id_ && |
| 5238 // Not interested in reloads. | 5238 // Not interested in reloads. |
| 5239 type != WebKit::WebNavigationTypeReload && | 5239 type != WebKit::WebNavigationTypeReload && |
| 5240 type != WebKit::WebNavigationTypeFormSubmitted) { | 5240 type != WebKit::WebNavigationTypeFormSubmitted && |
| 5241 type != WebKit::WebNavigationTypeBackForward) { |
| 5241 return true; | 5242 return true; |
| 5242 } | 5243 } |
| 5243 } | 5244 } |
| 5244 // Not interested in reloads. | 5245 // Not interested in reloads. |
| 5245 if (type != WebKit::WebNavigationTypeReload && | 5246 if (type != WebKit::WebNavigationTypeReload && |
| 5246 type != WebKit::WebNavigationTypeFormSubmitted) { | 5247 type != WebKit::WebNavigationTypeFormSubmitted && |
| 5248 type != WebKit::WebNavigationTypeBackForward) { |
| 5247 // The opener relationship between the new window and the parent allows the | 5249 // The opener relationship between the new window and the parent allows the |
| 5248 // new window to script the parent and vice versa. This is not allowed if | 5250 // new window to script the parent and vice versa. This is not allowed if |
| 5249 // the origins of the two domains are different. This can be treated as a | 5251 // the origins of the two domains are different. This can be treated as a |
| 5250 // top level navigation and routed back to the host. | 5252 // top level navigation and routed back to the host. |
| 5251 WebKit::WebFrame* opener = frame->opener(); | 5253 WebKit::WebFrame* opener = frame->opener(); |
| 5252 if (opener) { | 5254 if (opener) { |
| 5253 if (url.GetOrigin() != GURL(opener->url()).GetOrigin()) | 5255 if (url.GetOrigin() != GURL(opener->url()).GetOrigin()) |
| 5254 return true; | 5256 return true; |
| 5255 } | 5257 } |
| 5256 } | 5258 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 5267 webkit_glue::FormData form; | 5269 webkit_glue::FormData form; |
| 5268 const WebInputElement element = node.toConst<WebInputElement>(); | 5270 const WebInputElement element = node.toConst<WebInputElement>(); |
| 5269 if (!form_manager_.FindFormWithFormControlElement( | 5271 if (!form_manager_.FindFormWithFormControlElement( |
| 5270 element, FormManager::REQUIRE_NONE, &form)) | 5272 element, FormManager::REQUIRE_NONE, &form)) |
| 5271 return; | 5273 return; |
| 5272 | 5274 |
| 5273 autofill_action_ = action; | 5275 autofill_action_ = action; |
| 5274 Send(new ViewHostMsg_FillAutoFillFormData( | 5276 Send(new ViewHostMsg_FillAutoFillFormData( |
| 5275 routing_id_, autofill_query_id_, form, value, label)); | 5277 routing_id_, autofill_query_id_, form, value, label)); |
| 5276 } | 5278 } |
| OLD | NEW |