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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2050623005: Move file chooser from RenderView(Host) to RenderFrame(Host). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes based on reviews. Created 4 years, 6 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/common/frame_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 if (!render_frame_message_source_) { 723 if (!render_frame_message_source_) {
724 DCHECK(render_view_message_source_); 724 DCHECK(render_view_message_source_);
725 bad_message::ReceivedBadMessage(GetRenderProcessHost(), 725 bad_message::ReceivedBadMessage(GetRenderProcessHost(),
726 bad_message::WC_INVALID_FRAME_SOURCE); 726 bad_message::WC_INVALID_FRAME_SOURCE);
727 return false; 727 return false;
728 } 728 }
729 729
730 return true; 730 return true;
731 } 731 }
732 732
733 void WebContentsImpl::RunFileChooser(
734 RenderViewHost* render_view_host,
735 const FileChooserParams& params) {
736 if (delegate_)
737 delegate_->RunFileChooser(GetMainFrame(), params);
738 }
739
740 NavigationControllerImpl& WebContentsImpl::GetController() { 733 NavigationControllerImpl& WebContentsImpl::GetController() {
741 return controller_; 734 return controller_;
742 } 735 }
743 736
744 const NavigationControllerImpl& WebContentsImpl::GetController() const { 737 const NavigationControllerImpl& WebContentsImpl::GetController() const {
745 return controller_; 738 return controller_;
746 } 739 }
747 740
748 BrowserContext* WebContentsImpl::GetBrowserContext() const { 741 BrowserContext* WebContentsImpl::GetBrowserContext() const {
749 return controller_.GetBrowserContext(); 742 return controller_.GetBrowserContext();
(...skipping 3352 matching lines...) Expand 10 before | Expand all | Expand 10 after
4102 is_showing_before_unload_dialog_ = true; 4095 is_showing_before_unload_dialog_ = true;
4103 dialog_manager_ = delegate_->GetJavaScriptDialogManager(this); 4096 dialog_manager_ = delegate_->GetJavaScriptDialogManager(this);
4104 dialog_manager_->RunBeforeUnloadDialog( 4097 dialog_manager_->RunBeforeUnloadDialog(
4105 this, is_reload, 4098 this, is_reload,
4106 base::Bind(&WebContentsImpl::OnDialogClosed, base::Unretained(this), 4099 base::Bind(&WebContentsImpl::OnDialogClosed, base::Unretained(this),
4107 render_frame_host->GetProcess()->GetID(), 4100 render_frame_host->GetProcess()->GetID(),
4108 render_frame_host->GetRoutingID(), reply_msg, 4101 render_frame_host->GetRoutingID(), reply_msg,
4109 false)); 4102 false));
4110 } 4103 }
4111 4104
4105 void WebContentsImpl::RunFileChooser(RenderFrameHost* render_frame_host,
4106 const FileChooserParams& params) {
4107 if (delegate_)
4108 delegate_->RunFileChooser(render_frame_host, params);
4109 }
4110
4112 WebContents* WebContentsImpl::GetAsWebContents() { 4111 WebContents* WebContentsImpl::GetAsWebContents() {
4113 return this; 4112 return this;
4114 } 4113 }
4115 4114
4116 double WebContentsImpl::GetPendingPageZoomLevel() { 4115 double WebContentsImpl::GetPendingPageZoomLevel() {
4117 NavigationEntry* pending_entry = GetController().GetPendingEntry(); 4116 NavigationEntry* pending_entry = GetController().GetPendingEntry();
4118 if (!pending_entry) 4117 if (!pending_entry)
4119 return HostZoomMap::GetZoomLevel(this); 4118 return HostZoomMap::GetZoomLevel(this);
4120 4119
4121 GURL url = pending_entry->GetURL(); 4120 GURL url = pending_entry->GetURL();
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
5130 for (RenderViewHost* render_view_host : render_view_host_set) 5129 for (RenderViewHost* render_view_host : render_view_host_set)
5131 render_view_host->OnWebkitPreferencesChanged(); 5130 render_view_host->OnWebkitPreferencesChanged();
5132 } 5131 }
5133 5132
5134 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( 5133 void WebContentsImpl::SetJavaScriptDialogManagerForTesting(
5135 JavaScriptDialogManager* dialog_manager) { 5134 JavaScriptDialogManager* dialog_manager) {
5136 dialog_manager_ = dialog_manager; 5135 dialog_manager_ = dialog_manager;
5137 } 5136 }
5138 5137
5139 } // namespace content 5138 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/common/frame_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698