| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/guest_view/web_view/web_view_guest.h" | 5 #include "chrome/browser/guest_view/web_view/web_view_guest.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 guest_web_contents()); | 599 guest_web_contents()); |
| 600 if (content::Source<WebContents>(source).ptr() == guest_web_contents()) | 600 if (content::Source<WebContents>(source).ptr() == guest_web_contents()) |
| 601 LoadHandlerCalled(); | 601 LoadHandlerCalled(); |
| 602 break; | 602 break; |
| 603 } | 603 } |
| 604 case content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT: { | 604 case content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT: { |
| 605 DCHECK_EQ(content::Source<WebContents>(source).ptr(), | 605 DCHECK_EQ(content::Source<WebContents>(source).ptr(), |
| 606 guest_web_contents()); | 606 guest_web_contents()); |
| 607 content::ResourceRedirectDetails* resource_redirect_details = | 607 content::ResourceRedirectDetails* resource_redirect_details = |
| 608 content::Details<content::ResourceRedirectDetails>(details).ptr(); | 608 content::Details<content::ResourceRedirectDetails>(details).ptr(); |
| 609 bool is_top_level = | 609 bool is_top_level = resource_redirect_details->resource_type == |
| 610 resource_redirect_details->resource_type == ResourceType::MAIN_FRAME; | 610 content::RESOURCE_TYPE_MAIN_FRAME; |
| 611 LoadRedirect(resource_redirect_details->url, | 611 LoadRedirect(resource_redirect_details->url, |
| 612 resource_redirect_details->new_url, | 612 resource_redirect_details->new_url, |
| 613 is_top_level); | 613 is_top_level); |
| 614 break; | 614 break; |
| 615 } | 615 } |
| 616 default: | 616 default: |
| 617 NOTREACHED() << "Unexpected notification sent."; | 617 NOTREACHED() << "Unexpected notification sent."; |
| 618 break; | 618 break; |
| 619 } | 619 } |
| 620 } | 620 } |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 bool allow, | 1239 bool allow, |
| 1240 const std::string& user_input) { | 1240 const std::string& user_input) { |
| 1241 WebViewGuest* guest = | 1241 WebViewGuest* guest = |
| 1242 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); | 1242 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); |
| 1243 if (!guest) | 1243 if (!guest) |
| 1244 return; | 1244 return; |
| 1245 | 1245 |
| 1246 if (!allow) | 1246 if (!allow) |
| 1247 guest->Destroy(); | 1247 guest->Destroy(); |
| 1248 } | 1248 } |
| OLD | NEW |