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

Unified Diff: chrome/browser/ui/views/external_protocol_dialog.cc

Issue 107033003: Stop using GetDefaultProfile() in Chrome OS implementation of platform_util::OpenExternal() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove is_valid check Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/external_protocol_dialog.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/external_protocol_dialog.cc
diff --git a/chrome/browser/ui/views/external_protocol_dialog.cc b/chrome/browser/ui/views/external_protocol_dialog.cc
index c518de60c5b50f7470f6dbf12933dc08942e4d0f..8f63c3e9f3f540f64a576b058cb6a1d0a081c288 100644
--- a/chrome/browser/ui/views/external_protocol_dialog.cc
+++ b/chrome/browser/ui/views/external_protocol_dialog.cc
@@ -42,11 +42,8 @@ void ExternalProtocolHandler::RunExternalProtocolDialog(
// ShellExecute won't do anything. Don't bother warning the user.
return;
}
- WebContents* web_contents = tab_util::GetWebContentsByID(
- render_process_host_id, routing_id);
- DCHECK(web_contents);
// Windowing system takes ownership.
- new ExternalProtocolDialog(web_contents, url, command);
+ new ExternalProtocolDialog(url, render_process_host_id, routing_id, command);
}
///////////////////////////////////////////////////////////////////////////////
@@ -104,7 +101,8 @@ bool ExternalProtocolDialog::Accept() {
url_.scheme(), ExternalProtocolHandler::DONT_BLOCK);
}
- ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(url_);
+ ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(
+ url_, render_process_host_id_, routing_id_);
// Returning true closes the dialog.
return true;
}
@@ -124,11 +122,13 @@ const views::Widget* ExternalProtocolDialog::GetWidget() const {
///////////////////////////////////////////////////////////////////////////////
// ExternalProtocolDialog, private:
-ExternalProtocolDialog::ExternalProtocolDialog(WebContents* web_contents,
- const GURL& url,
+ExternalProtocolDialog::ExternalProtocolDialog(const GURL& url,
+ int render_process_host_id,
+ int routing_id,
const std::wstring& command)
- : web_contents_(web_contents),
- url_(url),
+ : url_(url),
+ render_process_host_id_(render_process_host_id),
+ routing_id_(routing_id),
creation_time_(base::TimeTicks::Now()) {
const int kMaxUrlWithoutSchemeSize = 256;
const int kMaxCommandSize = 256;
@@ -156,9 +156,11 @@ ExternalProtocolDialog::ExternalProtocolDialog(WebContents* web_contents,
l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT));
// Dialog is top level if we don't have a web_contents associated with us.
+ WebContents* web_contents = tab_util::GetWebContentsByID(
+ render_process_host_id_, routing_id_);
gfx::NativeWindow parent_window = NULL;
- if (web_contents_)
- parent_window = web_contents_->GetView()->GetTopLevelNativeWindow();
+ if (web_contents)
+ parent_window = web_contents->GetView()->GetTopLevelNativeWindow();
CreateBrowserModalDialogViews(this, parent_window)->Show();
}
« no previous file with comments | « chrome/browser/ui/views/external_protocol_dialog.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698