OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/views/profiles/profile_chooser_view.h" | 5 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/metrics/user_metrics.h" | 8 #include "base/metrics/user_metrics.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/app/vector_icons/vector_icons.h" | 10 #include "chrome/app/vector_icons/vector_icons.h" |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 : BubbleDialogDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), | 560 : BubbleDialogDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), |
561 browser_(browser), | 561 browser_(browser), |
562 view_mode_(view_mode), | 562 view_mode_(view_mode), |
563 tutorial_mode_(tutorial_mode), | 563 tutorial_mode_(tutorial_mode), |
564 gaia_service_type_(service_type), | 564 gaia_service_type_(service_type), |
565 access_point_(access_point) { | 565 access_point_(access_point) { |
566 // The sign in webview will be clipped on the bottom corners without these | 566 // The sign in webview will be clipped on the bottom corners without these |
567 // margins, see related bug <http://crbug.com/593203>. | 567 // margins, see related bug <http://crbug.com/593203>. |
568 set_margins(gfx::Insets(0, 0, 2, 0)); | 568 set_margins(gfx::Insets(0, 0, 2, 0)); |
569 ResetView(); | 569 ResetView(); |
| 570 chrome::RecordDialogCreation(chrome::DialogIdentifier::PROFILE_CHOOSER); |
570 } | 571 } |
571 | 572 |
572 ProfileChooserView::~ProfileChooserView() { | 573 ProfileChooserView::~ProfileChooserView() { |
573 ProfileOAuth2TokenService* oauth2_token_service = | 574 ProfileOAuth2TokenService* oauth2_token_service = |
574 ProfileOAuth2TokenServiceFactory::GetForProfile(browser_->profile()); | 575 ProfileOAuth2TokenServiceFactory::GetForProfile(browser_->profile()); |
575 if (oauth2_token_service) | 576 if (oauth2_token_service) |
576 oauth2_token_service->RemoveObserver(this); | 577 oauth2_token_service->RemoveObserver(this); |
577 } | 578 } |
578 | 579 |
579 void ProfileChooserView::ResetView() { | 580 void ProfileChooserView::ResetView() { |
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1892 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1893 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1893 IncognitoModePrefs::DISABLED; | 1894 IncognitoModePrefs::DISABLED; |
1894 return incognito_available && !browser_->profile()->IsGuestSession(); | 1895 return incognito_available && !browser_->profile()->IsGuestSession(); |
1895 } | 1896 } |
1896 | 1897 |
1897 void ProfileChooserView::PostActionPerformed( | 1898 void ProfileChooserView::PostActionPerformed( |
1898 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1899 ProfileMetrics::ProfileDesktopMenu action_performed) { |
1899 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1900 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
1900 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1901 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
1901 } | 1902 } |
OLD | NEW |