| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 default: | 117 default: |
| 118 NOTREACHED(); | 118 NOTREACHED(); |
| 119 } | 119 } |
| 120 return base::string16(); | 120 return base::string16(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 ui::ModalType PlatformVerificationDialog::GetModalType() const { | 123 ui::ModalType PlatformVerificationDialog::GetModalType() const { |
| 124 return ui::MODAL_TYPE_CHILD; | 124 return ui::MODAL_TYPE_CHILD; |
| 125 } | 125 } |
| 126 | 126 |
| 127 gfx::Size PlatformVerificationDialog::GetPreferredSize() { | 127 gfx::Size PlatformVerificationDialog::GetPreferredSize() const { |
| 128 return gfx::Size(kDialogMaxWidthInPixel, | 128 return gfx::Size(kDialogMaxWidthInPixel, |
| 129 GetHeightForWidth(kDialogMaxWidthInPixel)); | 129 GetHeightForWidth(kDialogMaxWidthInPixel)); |
| 130 } | 130 } |
| 131 | 131 |
| 132 void PlatformVerificationDialog::StyledLabelLinkClicked(const gfx::Range& range, | 132 void PlatformVerificationDialog::StyledLabelLinkClicked(const gfx::Range& range, |
| 133 int event_flags) { | 133 int event_flags) { |
| 134 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); | 134 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); |
| 135 const GURL learn_more_url(chrome::kEnhancedPlaybackNotificationLearnMoreURL); | 135 const GURL learn_more_url(chrome::kEnhancedPlaybackNotificationLearnMoreURL); |
| 136 | 136 |
| 137 // |web_contents_| might not be in a browser in case of v2 apps. In that case, | 137 // |web_contents_| might not be in a browser in case of v2 apps. In that case, |
| 138 // open a new tab in the usual way. | 138 // open a new tab in the usual way. |
| 139 if (!browser) { | 139 if (!browser) { |
| 140 Profile* profile = Profile::FromBrowserContext( | 140 Profile* profile = Profile::FromBrowserContext( |
| 141 web_contents_->GetBrowserContext()); | 141 web_contents_->GetBrowserContext()); |
| 142 chrome::NavigateParams params( | 142 chrome::NavigateParams params( |
| 143 profile, learn_more_url, content::PAGE_TRANSITION_LINK); | 143 profile, learn_more_url, content::PAGE_TRANSITION_LINK); |
| 144 params.disposition = SINGLETON_TAB; | 144 params.disposition = SINGLETON_TAB; |
| 145 chrome::Navigate(¶ms); | 145 chrome::Navigate(¶ms); |
| 146 } else { | 146 } else { |
| 147 chrome::ShowSingletonTab(browser, learn_more_url); | 147 chrome::ShowSingletonTab(browser, learn_more_url); |
| 148 } | 148 } |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace attestation | 151 } // namespace attestation |
| 152 } // namespace chromeos | 152 } // namespace chromeos |
| OLD | NEW |