| 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 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, |
| 35 int render_process_host_id, |
| 36 int routing_id, |
| 37 ui::PageTransition page_transition) { |
| 35 WebContents* web_contents = tab_util::GetWebContentsByID( | 38 WebContents* web_contents = tab_util::GetWebContentsByID( |
| 36 render_process_host_id, routing_id); | 39 render_process_host_id, routing_id); |
| 37 new ExternalProtocolDialog(web_contents, url); | 40 new ExternalProtocolDialog(web_contents, url); |
| 38 } | 41 } |
| 39 | 42 |
| 40 /////////////////////////////////////////////////////////////////////////////// | 43 /////////////////////////////////////////////////////////////////////////////// |
| 41 // ExternalProtocolDialog | 44 // ExternalProtocolDialog |
| 42 | 45 |
| 43 ExternalProtocolDialog::~ExternalProtocolDialog() { | 46 ExternalProtocolDialog::~ExternalProtocolDialog() { |
| 44 } | 47 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 110 |
| 108 gfx::NativeWindow parent_window; | 111 gfx::NativeWindow parent_window; |
| 109 if (web_contents) { | 112 if (web_contents) { |
| 110 parent_window = web_contents->GetTopLevelNativeWindow(); | 113 parent_window = web_contents->GetTopLevelNativeWindow(); |
| 111 } else { | 114 } else { |
| 112 // Dialog is top level if we don't have a web_contents associated with us. | 115 // Dialog is top level if we don't have a web_contents associated with us. |
| 113 parent_window = NULL; | 116 parent_window = NULL; |
| 114 } | 117 } |
| 115 views::DialogDelegate::CreateDialogWidget(this, NULL, parent_window)->Show(); | 118 views::DialogDelegate::CreateDialogWidget(this, NULL, parent_window)->Show(); |
| 116 } | 119 } |
| OLD | NEW |