Chromium Code Reviews| 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 #import "chrome/browser/ui/cocoa/external_protocol_dialog.h" | 5 #import "chrome/browser/ui/cocoa/external_protocol_dialog.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "chrome/browser/external_protocol/external_protocol_handler.h" | 9 #include "chrome/browser/external_protocol/external_protocol_handler.h" |
| 10 #include "chrome/browser/shell_integration.h" | 10 #include "chrome/browser/shell_integration.h" |
| 11 #include "chrome/browser/tab_contents/tab_util.h" | 11 #include "chrome/browser/tab_contents/tab_util.h" |
| 12 #include "chrome/browser/ui/browser_dialogs.h" | |
| 12 #include "chrome/grit/chromium_strings.h" | 13 #include "chrome/grit/chromium_strings.h" |
| 13 #include "chrome/grit/generated_resources.h" | 14 #include "chrome/grit/generated_resources.h" |
| 14 #include "components/strings/grit/components_strings.h" | 15 #include "components/strings/grit/components_strings.h" |
| 15 #include "ui/base/l10n/l10n_util_mac.h" | 16 #include "ui/base/l10n/l10n_util_mac.h" |
| 17 #include "ui/base/material_design/material_design_controller.h" | |
| 16 #include "ui/gfx/text_elider.h" | 18 #include "ui/gfx/text_elider.h" |
| 17 | 19 |
| 18 /////////////////////////////////////////////////////////////////////////////// | 20 /////////////////////////////////////////////////////////////////////////////// |
| 19 // ExternalProtocolHandler | 21 // ExternalProtocolHandler |
| 20 | 22 |
| 21 // static | 23 // static |
| 22 void ExternalProtocolHandler::RunExternalProtocolDialog( | 24 void ExternalProtocolHandler::RunExternalProtocolDialog( |
|
tapted
2017/01/17 21:17:13
I think we can move this definition to a new file
karandeepb
2017/01/24 03:23:32
Done.
| |
| 23 const GURL& url, int render_process_host_id, int routing_id, | 25 const GURL& url, int render_process_host_id, int routing_id, |
| 24 ui::PageTransition page_transition, bool has_user_gesture) { | 26 ui::PageTransition page_transition, bool has_user_gesture) { |
| 27 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) { | |
| 28 chrome::RunExternalProtocolDialogViews(url, render_process_host_id, | |
| 29 routing_id, page_transition, | |
| 30 has_user_gesture); | |
| 31 return; | |
| 32 } | |
| 25 [[ExternalProtocolDialogController alloc] initWithGURL:&url | 33 [[ExternalProtocolDialogController alloc] initWithGURL:&url |
| 26 renderProcessHostId:render_process_host_id | 34 renderProcessHostId:render_process_host_id |
| 27 routingId:routing_id]; | 35 routingId:routing_id]; |
| 28 } | 36 } |
| 29 | 37 |
| 30 /////////////////////////////////////////////////////////////////////////////// | 38 /////////////////////////////////////////////////////////////////////////////// |
| 31 // ExternalProtocolDialogController | 39 // ExternalProtocolDialogController |
| 32 | 40 |
| 33 @interface ExternalProtocolDialogController(Private) | 41 @interface ExternalProtocolDialogController(Private) |
| 34 - (void)alertEnded:(NSAlert *)alert | 42 - (void)alertEnded:(NSAlert *)alert |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 content::WebContents* web_contents = | 129 content::WebContents* web_contents = |
| 122 tab_util::GetWebContentsByID(render_process_host_id_, routing_id_); | 130 tab_util::GetWebContentsByID(render_process_host_id_, routing_id_); |
| 123 | 131 |
| 124 ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(url_, web_contents); | 132 ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(url_, web_contents); |
| 125 } | 133 } |
| 126 | 134 |
| 127 [self autorelease]; | 135 [self autorelease]; |
| 128 } | 136 } |
| 129 | 137 |
| 130 @end | 138 @end |
| OLD | NEW |