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 "chrome/browser/chromeos/external_protocol_dialog.h" | 5 #include "chrome/browser/chromeos/external_protocol_dialog.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/external_protocol/external_protocol_handler.h" | 10 #include "chrome/browser/external_protocol/external_protocol_handler.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 } // namespace | 28 } // namespace |
29 | 29 |
30 /////////////////////////////////////////////////////////////////////////////// | 30 /////////////////////////////////////////////////////////////////////////////// |
31 // ExternalProtocolHandler | 31 // ExternalProtocolHandler |
32 | 32 |
33 // static | 33 // static |
34 void ExternalProtocolHandler::RunExternalProtocolDialog( | 34 void ExternalProtocolHandler::RunExternalProtocolDialog( |
35 const GURL& url, int render_process_host_id, int routing_id) { | 35 const GURL& url, int render_process_host_id, int routing_id) { |
36 WebContents* web_contents = tab_util::GetWebContentsByID( | 36 WebContents* web_contents = tab_util::GetWebContentsByID( |
37 render_process_host_id, routing_id); | 37 render_process_host_id, routing_id); |
38 DCHECK(web_contents); | |
tburkard
2014/01/06 10:54:38
Why this change, seems like the semantics of |web_
jam
2014/01/06 15:44:18
I actually had to change this to fix a crash, so t
| |
39 new ExternalProtocolDialog(web_contents, url); | 38 new ExternalProtocolDialog(web_contents, url); |
40 } | 39 } |
41 | 40 |
42 /////////////////////////////////////////////////////////////////////////////// | 41 /////////////////////////////////////////////////////////////////////////////// |
43 // ExternalProtocolDialog | 42 // ExternalProtocolDialog |
44 | 43 |
45 ExternalProtocolDialog::~ExternalProtocolDialog() { | 44 ExternalProtocolDialog::~ExternalProtocolDialog() { |
46 } | 45 } |
47 | 46 |
48 ////////////////////////////////////////////////////////////////////////////// | 47 ////////////////////////////////////////////////////////////////////////////// |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 | 108 |
110 gfx::NativeWindow parent_window; | 109 gfx::NativeWindow parent_window; |
111 if (web_contents) { | 110 if (web_contents) { |
112 parent_window = web_contents->GetView()->GetTopLevelNativeWindow(); | 111 parent_window = web_contents->GetView()->GetTopLevelNativeWindow(); |
113 } else { | 112 } else { |
114 // Dialog is top level if we don't have a web_contents associated with us. | 113 // Dialog is top level if we don't have a web_contents associated with us. |
115 parent_window = NULL; | 114 parent_window = NULL; |
116 } | 115 } |
117 views::DialogDelegate::CreateDialogWidget(this, NULL, parent_window)->Show(); | 116 views::DialogDelegate::CreateDialogWidget(this, NULL, parent_window)->Show(); |
118 } | 117 } |
OLD | NEW |