| 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/browser/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "content/common/host_shared_bitmap_manager.h" | 38 #include "content/common/host_shared_bitmap_manager.h" |
| 39 #include "content/common/input_messages.h" | 39 #include "content/common/input_messages.h" |
| 40 #include "content/common/site_isolation_policy.h" | 40 #include "content/common/site_isolation_policy.h" |
| 41 #include "content/common/text_input_state.h" | 41 #include "content/common/text_input_state.h" |
| 42 #include "content/common/view_messages.h" | 42 #include "content/common/view_messages.h" |
| 43 #include "content/public/browser/browser_context.h" | 43 #include "content/public/browser/browser_context.h" |
| 44 #include "content/public/browser/browser_plugin_guest_manager.h" | 44 #include "content/public/browser/browser_plugin_guest_manager.h" |
| 45 #include "content/public/browser/content_browser_client.h" | 45 #include "content/public/browser/content_browser_client.h" |
| 46 #include "content/public/browser/guest_host.h" | 46 #include "content/public/browser/guest_host.h" |
| 47 #include "content/public/browser/guest_mode.h" | 47 #include "content/public/browser/guest_mode.h" |
| 48 #include "content/public/browser/navigation_handle.h" |
| 48 #include "content/public/browser/render_process_host.h" | 49 #include "content/public/browser/render_process_host.h" |
| 49 #include "content/public/browser/render_widget_host_view.h" | 50 #include "content/public/browser/render_widget_host_view.h" |
| 50 #include "content/public/browser/user_metrics.h" | 51 #include "content/public/browser/user_metrics.h" |
| 51 #include "content/public/browser/web_contents_observer.h" | 52 #include "content/public/browser/web_contents_observer.h" |
| 52 #include "content/public/common/drop_data.h" | 53 #include "content/public/common/drop_data.h" |
| 53 #include "ui/events/blink/web_input_event_traits.h" | 54 #include "ui/events/blink/web_input_event_traits.h" |
| 54 #include "ui/gfx/geometry/size_conversions.h" | 55 #include "ui/gfx/geometry/size_conversions.h" |
| 55 | 56 |
| 56 #if defined(OS_MACOSX) | 57 #if defined(OS_MACOSX) |
| 57 #include "content/browser/browser_plugin/browser_plugin_popup_menu_helper_mac.h" | 58 #include "content/browser/browser_plugin/browser_plugin_popup_menu_helper_mac.h" |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 // content::InterstitialPageImpl::DontProceed(). | 630 // content::InterstitialPageImpl::DontProceed(). |
| 630 // | 631 // |
| 631 // TODO(lazyboy): Write a WebUI test once http://crbug.com/463674 is fixed. | 632 // TODO(lazyboy): Write a WebUI test once http://crbug.com/463674 is fixed. |
| 632 return; | 633 return; |
| 633 } | 634 } |
| 634 | 635 |
| 635 if (last_text_input_state_.get()) | 636 if (last_text_input_state_.get()) |
| 636 guest_rwhv->TextInputStateChanged(*last_text_input_state_); | 637 guest_rwhv->TextInputStateChanged(*last_text_input_state_); |
| 637 } | 638 } |
| 638 | 639 |
| 639 void BrowserPluginGuest::DidCommitProvisionalLoadForFrame( | 640 void BrowserPluginGuest::DidFinishNavigation( |
| 640 RenderFrameHost* render_frame_host, | 641 NavigationHandle* navigation_handle) { |
| 641 const GURL& url, | 642 if (navigation_handle->HasCommitted()) |
| 642 ui::PageTransition transition_type) { | 643 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); |
| 643 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); | |
| 644 } | 644 } |
| 645 | 645 |
| 646 void BrowserPluginGuest::RenderViewReady() { | 646 void BrowserPluginGuest::RenderViewReady() { |
| 647 RenderViewHost* rvh = GetWebContents()->GetRenderViewHost(); | 647 RenderViewHost* rvh = GetWebContents()->GetRenderViewHost(); |
| 648 // TODO(fsamuel): Investigate whether it's possible to update state earlier | 648 // TODO(fsamuel): Investigate whether it's possible to update state earlier |
| 649 // here (see http://crbug.com/158151). | 649 // here (see http://crbug.com/158151). |
| 650 Send(new InputMsg_SetFocus(routing_id(), focused_)); | 650 Send(new InputMsg_SetFocus(routing_id(), focused_)); |
| 651 UpdateVisibility(); | 651 UpdateVisibility(); |
| 652 | 652 |
| 653 // In case we've created a new guest render process after a crash, let the | 653 // In case we've created a new guest render process after a crash, let the |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 range, character_bounds); | 1050 range, character_bounds); |
| 1051 } | 1051 } |
| 1052 #endif | 1052 #endif |
| 1053 | 1053 |
| 1054 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { | 1054 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { |
| 1055 if (delegate_) | 1055 if (delegate_) |
| 1056 delegate_->SetContextMenuPosition(position); | 1056 delegate_->SetContextMenuPosition(position); |
| 1057 } | 1057 } |
| 1058 | 1058 |
| 1059 } // namespace content | 1059 } // namespace content |
| OLD | NEW |