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/one_click_signin_view_controller.h" | 5 #import "chrome/browser/ui/cocoa/one_click_signin_view_controller.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/mac/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
10 #import "chrome/browser/ui/chrome_style.h" | 10 #import "chrome/browser/ui/chrome_style.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 if (isSyncDialog_) { | 104 if (isSyncDialog_) { |
105 signin_metrics::LogSigninConfirmHistogramValue( | 105 signin_metrics::LogSigninConfirmHistogramValue( |
106 clickedLearnMore_ ? | 106 clickedLearnMore_ ? |
107 signin_metrics::HISTOGRAM_CONFIRM_LEARN_MORE_ADVANCED : | 107 signin_metrics::HISTOGRAM_CONFIRM_LEARN_MORE_ADVANCED : |
108 signin_metrics::HISTOGRAM_CONFIRM_ADVANCED); | 108 signin_metrics::HISTOGRAM_CONFIRM_ADVANCED); |
109 | 109 |
110 base::ResetAndReturn(&startSyncCallback_).Run( | 110 base::ResetAndReturn(&startSyncCallback_).Run( |
111 OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST); | 111 OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST); |
112 } | 112 } |
113 else { | 113 else { |
114 content::OpenURLParams params(GURL(chrome::kChromeUISettingsURL), | 114 content::OpenURLParams params( |
115 content::Referrer(), CURRENT_TAB, | 115 GURL(chrome::kChromeUISettingsURL), content::Referrer(), |
116 ui::PAGE_TRANSITION_LINK, false); | 116 WindowOpenDisposition::CURRENT_TAB, ui::PAGE_TRANSITION_LINK, false); |
117 webContents_->OpenURL(params); | 117 webContents_->OpenURL(params); |
118 } | 118 } |
119 [self close]; | 119 [self close]; |
120 } | 120 } |
121 | 121 |
122 - (IBAction)onClickClose:(id)sender { | 122 - (IBAction)onClickClose:(id)sender { |
123 if (isSyncDialog_) { | 123 if (isSyncDialog_) { |
124 signin_metrics::LogSigninConfirmHistogramValue( | 124 signin_metrics::LogSigninConfirmHistogramValue( |
125 clickedLearnMore_ ? | 125 clickedLearnMore_ ? |
126 signin_metrics::HISTOGRAM_CONFIRM_LEARN_MORE_CLOSE : | 126 signin_metrics::HISTOGRAM_CONFIRM_LEARN_MORE_CLOSE : |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 281 |
282 - (BOOL)textView:(NSTextView*)textView | 282 - (BOOL)textView:(NSTextView*)textView |
283 clickedOnLink:(id)link | 283 clickedOnLink:(id)link |
284 atIndex:(NSUInteger)charIndex { | 284 atIndex:(NSUInteger)charIndex { |
285 if (isSyncDialog_ && !clickedLearnMore_) { | 285 if (isSyncDialog_ && !clickedLearnMore_) { |
286 clickedLearnMore_ = YES; | 286 clickedLearnMore_ = YES; |
287 | 287 |
288 signin_metrics::LogSigninConfirmHistogramValue( | 288 signin_metrics::LogSigninConfirmHistogramValue( |
289 signin_metrics::HISTOGRAM_CONFIRM_LEARN_MORE); | 289 signin_metrics::HISTOGRAM_CONFIRM_LEARN_MORE); |
290 } | 290 } |
291 WindowOpenDisposition location = isSyncDialog_ ? | 291 WindowOpenDisposition location = |
292 NEW_WINDOW : NEW_FOREGROUND_TAB; | 292 isSyncDialog_ ? WindowOpenDisposition::NEW_WINDOW |
| 293 : WindowOpenDisposition::NEW_FOREGROUND_TAB; |
293 content::OpenURLParams params(GURL(chrome::kChromeSyncLearnMoreURL), | 294 content::OpenURLParams params(GURL(chrome::kChromeSyncLearnMoreURL), |
294 content::Referrer(), location, | 295 content::Referrer(), location, |
295 ui::PAGE_TRANSITION_LINK, false); | 296 ui::PAGE_TRANSITION_LINK, false); |
296 webContents_->OpenURL(params); | 297 webContents_->OpenURL(params); |
297 return YES; | 298 return YES; |
298 } | 299 } |
299 | 300 |
300 - (void)close { | 301 - (void)close { |
301 base::ResetAndReturn(&closeCallback_).Run(); | 302 base::ResetAndReturn(&closeCallback_).Run(); |
302 } | 303 } |
303 | 304 |
304 @end | 305 @end |
305 | 306 |
306 @implementation OneClickSigninViewController (TestingAPI) | 307 @implementation OneClickSigninViewController (TestingAPI) |
307 | 308 |
308 - (NSTextView*)linkViewForTesting { | 309 - (NSTextView*)linkViewForTesting { |
309 return informativeTextView_.get(); | 310 return informativeTextView_.get(); |
310 } | 311 } |
311 | 312 |
312 @end | 313 @end |
OLD | NEW |