Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: content/browser/frame_host/interstitial_page_impl.cc

Issue 1162373002: Make some editing/selection functions accessible to c/b/renderer_host/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Used scoped_refptr Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 if (!focused_node)
433 return;
434
435 focused_node->current_frame_host()->Send(
436 new InputMsg_Cut(focused_node->current_frame_host()->GetRoutingID()));
437 RecordAction(base::UserMetricsAction("Cut"));
438 }
439
440 void InterstitialPageImpl::Copy() {
441 FrameTreeNode* focused_node = frame_tree_.GetFocusedFrame();
442 if (!focused_node)
443 return;
444
445 focused_node->current_frame_host()->Send(
446 new InputMsg_Copy(focused_node->current_frame_host()->GetRoutingID()));
447 RecordAction(base::UserMetricsAction("Copy"));
448 }
449
450 void InterstitialPageImpl::Paste() {
451 FrameTreeNode* focused_node = frame_tree_.GetFocusedFrame();
452 if (!focused_node)
453 return;
454
455 focused_node->current_frame_host()->Send(
456 new InputMsg_Paste(focused_node->current_frame_host()->GetRoutingID()));
457 RecordAction(base::UserMetricsAction("Paste"));
458 }
459
429 RenderViewHostDelegateView* InterstitialPageImpl::GetDelegateView() { 460 RenderViewHostDelegateView* InterstitialPageImpl::GetDelegateView() {
430 return rvh_delegate_view_.get(); 461 return rvh_delegate_view_.get();
431 } 462 }
432 463
433 const GURL& InterstitialPageImpl::GetMainFrameLastCommittedURL() const { 464 const GURL& InterstitialPageImpl::GetMainFrameLastCommittedURL() const {
434 return url_; 465 return url_;
435 } 466 }
436 467
437 void InterstitialPageImpl::RenderViewTerminated( 468 void InterstitialPageImpl::RenderViewTerminated(
438 RenderViewHost* render_view_host, 469 RenderViewHost* render_view_host,
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 void InterstitialPageImpl::UnderlyingContentObserver::NavigationEntryCommitted( 928 void InterstitialPageImpl::UnderlyingContentObserver::NavigationEntryCommitted(
898 const LoadCommittedDetails& load_details) { 929 const LoadCommittedDetails& load_details) {
899 interstitial_->OnNavigatingAwayOrTabClosing(); 930 interstitial_->OnNavigatingAwayOrTabClosing();
900 } 931 }
901 932
902 void InterstitialPageImpl::UnderlyingContentObserver::WebContentsDestroyed() { 933 void InterstitialPageImpl::UnderlyingContentObserver::WebContentsDestroyed() {
903 interstitial_->OnNavigatingAwayOrTabClosing(); 934 interstitial_->OnNavigatingAwayOrTabClosing();
904 } 935 }
905 936
906 } // namespace content 937 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/interstitial_page_impl.h ('k') | content/browser/frame_host/interstitial_page_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698