| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/attestation/platform_verification_dialog.h" | 5 #include "chrome/browser/chromeos/attestation/platform_verification_dialog.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/browser_finder.h" | 9 #include "chrome/browser/ui/browser_finder.h" |
| 10 #include "chrome/browser/ui/browser_navigator.h" | 10 #include "chrome/browser/ui/browser_navigator.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 extensions::ExtensionRegistry::Get(web_contents->GetBrowserContext())-> | 47 extensions::ExtensionRegistry::Get(web_contents->GetBrowserContext())-> |
| 48 enabled_extensions().GetExtensionOrAppByURL(url); | 48 enabled_extensions().GetExtensionOrAppByURL(url); |
| 49 std::string origin = extension ? extension->name() : url.GetOrigin().spec(); | 49 std::string origin = extension ? extension->name() : url.GetOrigin().spec(); |
| 50 | 50 |
| 51 PlatformVerificationDialog* dialog = new PlatformVerificationDialog( | 51 PlatformVerificationDialog* dialog = new PlatformVerificationDialog( |
| 52 web_contents, | 52 web_contents, |
| 53 base::UTF8ToUTF16(origin), | 53 base::UTF8ToUTF16(origin), |
| 54 callback); | 54 callback); |
| 55 | 55 |
| 56 // Sets up the dialog widget and shows it. | 56 // Sets up the dialog widget and shows it. |
| 57 // TODO(gbillock): Use PopupManager here. |
| 57 web_modal::WebContentsModalDialogManager* web_contents_modal_dialog_manager = | 58 web_modal::WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
| 58 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents); | 59 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents); |
| 59 web_modal::WebContentsModalDialogManagerDelegate* modal_delegate = | 60 web_modal::WebContentsModalDialogManagerDelegate* modal_delegate = |
| 60 web_contents_modal_dialog_manager->delegate(); | 61 web_contents_modal_dialog_manager->delegate(); |
| 61 views::Widget* widget = views::Widget::CreateWindowAsFramelessChild( | 62 views::Widget* widget = views::Widget::CreateWindowAsFramelessChild( |
| 62 dialog, modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); | 63 dialog, modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); |
| 63 web_contents_modal_dialog_manager->ShowModalDialog( | 64 web_contents_modal_dialog_manager->ShowModalDialog( |
| 64 widget->GetNativeView()); | 65 widget->GetNativeView()); |
| 65 widget->Show(); | 66 widget->Show(); |
| 66 } | 67 } |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 profile, learn_more_url, content::PAGE_TRANSITION_LINK); | 144 profile, learn_more_url, content::PAGE_TRANSITION_LINK); |
| 144 params.disposition = SINGLETON_TAB; | 145 params.disposition = SINGLETON_TAB; |
| 145 chrome::Navigate(¶ms); | 146 chrome::Navigate(¶ms); |
| 146 } else { | 147 } else { |
| 147 chrome::ShowSingletonTab(browser, learn_more_url); | 148 chrome::ShowSingletonTab(browser, learn_more_url); |
| 148 } | 149 } |
| 149 } | 150 } |
| 150 | 151 |
| 151 } // namespace attestation | 152 } // namespace attestation |
| 152 } // namespace chromeos | 153 } // namespace chromeos |
| OLD | NEW |