OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/interstitial_page_impl.h" | 5 #include "content/browser/frame_host/interstitial_page_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 11 matching lines...) Expand all Loading... | |
22 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 22 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
23 #include "content/browser/renderer_host/render_process_host_impl.h" | 23 #include "content/browser/renderer_host/render_process_host_impl.h" |
24 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 24 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
25 #include "content/browser/renderer_host/render_view_host_factory.h" | 25 #include "content/browser/renderer_host/render_view_host_factory.h" |
26 #include "content/browser/renderer_host/render_view_host_impl.h" | 26 #include "content/browser/renderer_host/render_view_host_impl.h" |
27 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 27 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
28 #include "content/browser/site_instance_impl.h" | 28 #include "content/browser/site_instance_impl.h" |
29 #include "content/browser/web_contents/web_contents_impl.h" | 29 #include "content/browser/web_contents/web_contents_impl.h" |
30 #include "content/browser/web_contents/web_contents_view.h" | 30 #include "content/browser/web_contents/web_contents_view.h" |
31 #include "content/common/frame_messages.h" | 31 #include "content/common/frame_messages.h" |
32 #include "content/common/input_messages.h" | |
32 #include "content/common/view_messages.h" | 33 #include "content/common/view_messages.h" |
33 #include "content/public/browser/browser_context.h" | 34 #include "content/public/browser/browser_context.h" |
34 #include "content/public/browser/browser_thread.h" | 35 #include "content/public/browser/browser_thread.h" |
35 #include "content/public/browser/content_browser_client.h" | 36 #include "content/public/browser/content_browser_client.h" |
36 #include "content/public/browser/dom_operation_notification_details.h" | 37 #include "content/public/browser/dom_operation_notification_details.h" |
37 #include "content/public/browser/interstitial_page_delegate.h" | 38 #include "content/public/browser/interstitial_page_delegate.h" |
38 #include "content/public/browser/invalidate_type.h" | 39 #include "content/public/browser/invalidate_type.h" |
39 #include "content/public/browser/notification_service.h" | 40 #include "content/public/browser/notification_service.h" |
40 #include "content/public/browser/notification_source.h" | 41 #include "content/public/browser/notification_source.h" |
41 #include "content/public/browser/storage_partition.h" | 42 #include "content/public/browser/storage_partition.h" |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
419 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_TITLE); | 420 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_TITLE); |
420 } | 421 } |
421 | 422 |
422 AccessibilityMode InterstitialPageImpl::GetAccessibilityMode() const { | 423 AccessibilityMode InterstitialPageImpl::GetAccessibilityMode() const { |
423 if (web_contents_) | 424 if (web_contents_) |
424 return static_cast<WebContentsImpl*>(web_contents_)->GetAccessibilityMode(); | 425 return static_cast<WebContentsImpl*>(web_contents_)->GetAccessibilityMode(); |
425 else | 426 else |
426 return AccessibilityModeOff; | 427 return AccessibilityModeOff; |
427 } | 428 } |
428 | 429 |
430 void InterstitialPageImpl::Cut() { | |
431 FrameTreeNode* focused_node = frame_tree_.GetFocusedFrame(); | |
432 RenderFrameHostImpl* focused_frame = | |
433 focused_node ? focused_node->current_frame_host() : nullptr; | |
434 if (!focused_frame) | |
dcheng
2015/06/29 17:58:02
Question: can you have a situation where focused_n
mohsen
2015/06/29 21:46:53
This is the case I saw in tests and that's why I e
| |
435 return; | |
436 | |
437 focused_frame->Send(new InputMsg_Cut(focused_frame->GetRoutingID())); | |
438 RecordAction(base::UserMetricsAction("Cut")); | |
439 } | |
440 | |
441 void InterstitialPageImpl::Copy() { | |
442 FrameTreeNode* focused_node = frame_tree_.GetFocusedFrame(); | |
443 RenderFrameHostImpl* focused_frame = | |
444 focused_node ? focused_node->current_frame_host() : nullptr; | |
445 if (!focused_frame) | |
446 return; | |
447 | |
448 focused_frame->Send(new InputMsg_Copy(focused_frame->GetRoutingID())); | |
449 RecordAction(base::UserMetricsAction("Copy")); | |
450 } | |
451 | |
452 void InterstitialPageImpl::Paste() { | |
453 FrameTreeNode* focused_node = frame_tree_.GetFocusedFrame(); | |
454 RenderFrameHostImpl* focused_frame = | |
455 focused_node ? focused_node->current_frame_host() : nullptr; | |
456 if (!focused_frame) | |
457 return; | |
dcheng
2015/06/29 17:58:02
It almost seems like we should have a helper for t
mohsen
2015/06/29 21:46:53
Not applicable, anymore, I guess.
| |
458 | |
459 focused_frame->Send(new InputMsg_Paste(focused_frame->GetRoutingID())); | |
460 RecordAction(base::UserMetricsAction("Paste")); | |
461 } | |
462 | |
429 RenderViewHostDelegateView* InterstitialPageImpl::GetDelegateView() { | 463 RenderViewHostDelegateView* InterstitialPageImpl::GetDelegateView() { |
430 return rvh_delegate_view_.get(); | 464 return rvh_delegate_view_.get(); |
431 } | 465 } |
432 | 466 |
433 const GURL& InterstitialPageImpl::GetMainFrameLastCommittedURL() const { | 467 const GURL& InterstitialPageImpl::GetMainFrameLastCommittedURL() const { |
434 return url_; | 468 return url_; |
435 } | 469 } |
436 | 470 |
437 void InterstitialPageImpl::RenderViewTerminated( | 471 void InterstitialPageImpl::RenderViewTerminated( |
438 RenderViewHost* render_view_host, | 472 RenderViewHost* render_view_host, |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
897 void InterstitialPageImpl::UnderlyingContentObserver::NavigationEntryCommitted( | 931 void InterstitialPageImpl::UnderlyingContentObserver::NavigationEntryCommitted( |
898 const LoadCommittedDetails& load_details) { | 932 const LoadCommittedDetails& load_details) { |
899 interstitial_->OnNavigatingAwayOrTabClosing(); | 933 interstitial_->OnNavigatingAwayOrTabClosing(); |
900 } | 934 } |
901 | 935 |
902 void InterstitialPageImpl::UnderlyingContentObserver::WebContentsDestroyed() { | 936 void InterstitialPageImpl::UnderlyingContentObserver::WebContentsDestroyed() { |
903 interstitial_->OnNavigatingAwayOrTabClosing(); | 937 interstitial_->OnNavigatingAwayOrTabClosing(); |
904 } | 938 } |
905 | 939 |
906 } // namespace content | 940 } // namespace content |
OLD | NEW |