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/ui/views/external_protocol_dialog.h" | 5 #include "chrome/browser/ui/views/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 13 matching lines...) Expand all Loading... |
24 | 24 |
25 const int kMessageWidth = 400; | 25 const int kMessageWidth = 400; |
26 | 26 |
27 } // namespace | 27 } // namespace |
28 | 28 |
29 /////////////////////////////////////////////////////////////////////////////// | 29 /////////////////////////////////////////////////////////////////////////////// |
30 // ExternalProtocolHandler | 30 // ExternalProtocolHandler |
31 | 31 |
32 // static | 32 // static |
33 void ExternalProtocolHandler::RunExternalProtocolDialog( | 33 void ExternalProtocolHandler::RunExternalProtocolDialog( |
34 const GURL& url, int render_process_host_id, int routing_id) { | 34 const GURL& url, int render_process_host_id, int routing_id, |
| 35 ui::PageTransition page_transition, bool has_user_gesture) { |
35 scoped_ptr<ExternalProtocolDialogDelegate> delegate( | 36 scoped_ptr<ExternalProtocolDialogDelegate> delegate( |
36 new ExternalProtocolDialogDelegate(url, | 37 new ExternalProtocolDialogDelegate(url, |
37 render_process_host_id, | 38 render_process_host_id, |
38 routing_id)); | 39 routing_id)); |
39 if (delegate->program_name().empty()) { | 40 if (delegate->program_name().empty()) { |
40 // ShellExecute won't do anything. Don't bother warning the user. | 41 // ShellExecute won't do anything. Don't bother warning the user. |
41 return; | 42 return; |
42 } | 43 } |
43 | 44 |
44 // Windowing system takes ownership. | 45 // Windowing system takes ownership. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 132 |
132 // Dialog is top level if we don't have a web_contents associated with us. | 133 // Dialog is top level if we don't have a web_contents associated with us. |
133 WebContents* web_contents = tab_util::GetWebContentsByID( | 134 WebContents* web_contents = tab_util::GetWebContentsByID( |
134 render_process_host_id_, routing_id_); | 135 render_process_host_id_, routing_id_); |
135 gfx::NativeWindow parent_window = NULL; | 136 gfx::NativeWindow parent_window = NULL; |
136 if (web_contents) | 137 if (web_contents) |
137 parent_window = web_contents->GetTopLevelNativeWindow(); | 138 parent_window = web_contents->GetTopLevelNativeWindow(); |
138 constrained_window::CreateBrowserModalDialogViews(this, | 139 constrained_window::CreateBrowserModalDialogViews(this, |
139 parent_window)->Show(); | 140 parent_window)->Show(); |
140 } | 141 } |
OLD | NEW |