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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 bool is_form_post) { | 511 bool is_form_post) { |
512 if (!IsTopLevelNavigation(frame)) | 512 if (!IsTopLevelNavigation(frame)) |
513 return false; | 513 return false; |
514 | 514 |
515 // Navigations initiated within Webkit are not sent out to the external host | 515 // Navigations initiated within Webkit are not sent out to the external host |
516 // in the following cases. | 516 // in the following cases. |
517 // 1. The url scheme is not http/https | 517 // 1. The url scheme is not http/https |
518 // 2. The origin of the url and the opener is the same in which case the | 518 // 2. The origin of the url and the opener is the same in which case the |
519 // opener relationship is maintained. | 519 // opener relationship is maintained. |
520 // 3. Reloads/form submits/back forward navigations | 520 // 3. Reloads/form submits/back forward navigations |
521 if (!url.SchemeIs(chrome::kHttpScheme) && !url.SchemeIs(chrome::kHttpsScheme)) | 521 if (!url.SchemeIs(chrome::kHttpScheme) && !url.SchemeIs(kHttpsScheme)) |
522 return false; | 522 return false; |
523 | 523 |
524 if (type != WebKit::WebNavigationTypeReload && | 524 if (type != WebKit::WebNavigationTypeReload && |
525 type != WebKit::WebNavigationTypeBackForward && !is_form_post) { | 525 type != WebKit::WebNavigationTypeBackForward && !is_form_post) { |
526 // The opener relationship between the new window and the parent allows the | 526 // The opener relationship between the new window and the parent allows the |
527 // new window to script the parent and vice versa. This is not allowed if | 527 // new window to script the parent and vice versa. This is not allowed if |
528 // the origins of the two domains are different. This can be treated as a | 528 // the origins of the two domains are different. This can be treated as a |
529 // top level navigation and routed back to the host. | 529 // top level navigation and routed back to the host. |
530 WebKit::WebFrame* opener = frame->opener(); | 530 WebKit::WebFrame* opener = frame->opener(); |
531 if (!opener) | 531 if (!opener) |
(...skipping 6004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6536 std::vector<FaviconURL> urls; | 6536 std::vector<FaviconURL> urls; |
6537 for (size_t i = 0; i < icon_urls.size(); i++) { | 6537 for (size_t i = 0; i < icon_urls.size(); i++) { |
6538 WebURL url = icon_urls[i].iconURL(); | 6538 WebURL url = icon_urls[i].iconURL(); |
6539 if (!url.isEmpty()) | 6539 if (!url.isEmpty()) |
6540 urls.push_back(FaviconURL(url, | 6540 urls.push_back(FaviconURL(url, |
6541 ToFaviconType(icon_urls[i].iconType()))); | 6541 ToFaviconType(icon_urls[i].iconType()))); |
6542 } | 6542 } |
6543 SendUpdateFaviconURL(urls); | 6543 SendUpdateFaviconURL(urls); |
6544 } | 6544 } |
6545 | 6545 |
6546 | |
6547 } // namespace content | 6546 } // namespace content |
OLD | NEW |