| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); | 136 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); |
| 137 const GURL learn_more_url(chrome::kEnhancedPlaybackNotificationLearnMoreURL); | 137 const GURL learn_more_url(chrome::kEnhancedPlaybackNotificationLearnMoreURL); |
| 138 | 138 |
| 139 // |web_contents()| might not be in a browser in case of v2 apps. In that | 139 // |web_contents()| might not be in a browser in case of v2 apps. In that |
| 140 // case, open a new tab in the usual way. | 140 // case, open a new tab in the usual way. |
| 141 if (!browser) { | 141 if (!browser) { |
| 142 Profile* profile = | 142 Profile* profile = |
| 143 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | 143 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
| 144 chrome::NavigateParams params( | 144 chrome::NavigateParams params( |
| 145 profile, learn_more_url, ui::PAGE_TRANSITION_LINK); | 145 profile, learn_more_url, ui::PAGE_TRANSITION_LINK); |
| 146 params.disposition = SINGLETON_TAB; | 146 params.disposition = WindowOpenDisposition::SINGLETON_TAB; |
| 147 chrome::Navigate(¶ms); | 147 chrome::Navigate(¶ms); |
| 148 } else { | 148 } else { |
| 149 chrome::ShowSingletonTab(browser, learn_more_url); | 149 chrome::ShowSingletonTab(browser, learn_more_url); |
| 150 } | 150 } |
| 151 } | 151 } |
| 152 | 152 |
| 153 void PlatformVerificationDialog::DidStartNavigationToPendingEntry( | 153 void PlatformVerificationDialog::DidStartNavigationToPendingEntry( |
| 154 const GURL& url, | 154 const GURL& url, |
| 155 content::NavigationController::ReloadType reload_type) { | 155 content::NavigationController::ReloadType reload_type) { |
| 156 views::Widget* widget = GetWidget(); | 156 views::Widget* widget = GetWidget(); |
| 157 if (widget) | 157 if (widget) |
| 158 widget->Close(); | 158 widget->Close(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 } // namespace attestation | 161 } // namespace attestation |
| 162 } // namespace chromeos | 162 } // namespace chromeos |
| OLD | NEW |