Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: chrome/browser/chromeos/attestation/platform_verification_dialog.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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(&params); 145 chrome::Navigate(&params);
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/attestation/platform_verification_dialog.h ('k') | chrome/browser/chromeos/enrollment_dialog_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698