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 "extensions/browser/guest_view/web_view/web_view_guest.h" | 5 #include "extensions/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 "components/browsing_data/storage_partition_http_cache_data_remover.h" | 10 #include "components/browsing_data/storage_partition_http_cache_data_remover.h" |
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 src_ = url; | 789 src_ = url; |
790 // Handle a pending zoom if one exists. | 790 // Handle a pending zoom if one exists. |
791 if (pending_zoom_factor_) { | 791 if (pending_zoom_factor_) { |
792 SetZoom(pending_zoom_factor_); | 792 SetZoom(pending_zoom_factor_); |
793 pending_zoom_factor_ = 0.0; | 793 pending_zoom_factor_ = 0.0; |
794 } | 794 } |
795 } | 795 } |
796 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 796 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
797 args->SetString(guest_view::kUrl, url.spec()); | 797 args->SetString(guest_view::kUrl, url.spec()); |
798 args->SetBoolean(guest_view::kIsTopLevel, !render_frame_host->GetParent()); | 798 args->SetBoolean(guest_view::kIsTopLevel, !render_frame_host->GetParent()); |
799 args->SetString(webview::kInternalBaseURLForDataURL, | 799 args->SetString( |
800 web_contents() | 800 webview::kInternalBaseURLForDataURL, |
801 ->GetController() | 801 web_contents()->GetController().GetLastCommittedEntry()->GetURL().spec()); |
802 .GetLastCommittedEntry() | |
803 ->GetBaseURLForDataURL() | |
804 .spec()); | |
805 args->SetInteger(webview::kInternalCurrentEntryIndex, | 802 args->SetInteger(webview::kInternalCurrentEntryIndex, |
806 web_contents()->GetController().GetCurrentEntryIndex()); | 803 web_contents()->GetController().GetCurrentEntryIndex()); |
807 args->SetInteger(webview::kInternalEntryCount, | 804 args->SetInteger(webview::kInternalEntryCount, |
808 web_contents()->GetController().GetEntryCount()); | 805 web_contents()->GetController().GetEntryCount()); |
809 args->SetInteger(webview::kInternalProcessId, | 806 args->SetInteger(webview::kInternalProcessId, |
810 web_contents()->GetRenderProcessHost()->GetID()); | 807 web_contents()->GetRenderProcessHost()->GetID()); |
811 DispatchEventToView( | 808 DispatchEventToView( |
812 new GuestViewEvent(webview::kEventLoadCommit, args.Pass())); | 809 new GuestViewEvent(webview::kEventLoadCommit, args.Pass())); |
813 | 810 |
814 find_helper_.CancelAllFindSessions(); | 811 find_helper_.CancelAllFindSessions(); |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 1490 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
1494 DispatchEventToView( | 1491 DispatchEventToView( |
1495 new GuestViewEvent(webview::kEventExitFullscreen, args.Pass())); | 1492 new GuestViewEvent(webview::kEventExitFullscreen, args.Pass())); |
1496 } | 1493 } |
1497 // Since we changed fullscreen state, sending a Resize message ensures that | 1494 // Since we changed fullscreen state, sending a Resize message ensures that |
1498 // renderer/ sees the change. | 1495 // renderer/ sees the change. |
1499 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); | 1496 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); |
1500 } | 1497 } |
1501 | 1498 |
1502 } // namespace extensions | 1499 } // namespace extensions |
OLD | NEW |