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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/lifetime/application_lifetime.h" | 10 #include "chrome/browser/lifetime/application_lifetime.h" |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
501 } | 501 } |
502 return; | 502 return; |
503 } | 503 } |
504 | 504 |
505 profile_bubble_ = new ProfileChooserView(anchor_view, arrow, browser, | 505 profile_bubble_ = new ProfileChooserView(anchor_view, arrow, browser, |
506 view_mode, tutorial_mode, manage_accounts_params.service_type); | 506 view_mode, tutorial_mode, manage_accounts_params.service_type); |
507 views::BubbleDelegateView::CreateBubble(profile_bubble_); | 507 views::BubbleDelegateView::CreateBubble(profile_bubble_); |
508 profile_bubble_->set_close_on_deactivate(close_on_deactivate_for_testing_); | 508 profile_bubble_->set_close_on_deactivate(close_on_deactivate_for_testing_); |
509 profile_bubble_->SetAlignment(border_alignment); | 509 profile_bubble_->SetAlignment(border_alignment); |
510 profile_bubble_->GetWidget()->Show(); | 510 profile_bubble_->GetWidget()->Show(); |
511 // On first showing the bubble, focus the signin button. This needs to be | |
512 // done here, since the first call to ShowView() happens before the view's | |
513 // FocusManager has been created. | |
514 if (view_mode == profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER && | |
515 profile_bubble_->signin_current_profile_link_) { | |
516 profile_bubble_->signin_current_profile_link_->RequestFocus(); | |
msw
2015/07/13 20:06:22
Make ProfileChooserView override WidgetDelegate's
wjmaclean
2015/07/13 21:11:40
Done.
| |
517 } | |
511 profile_bubble_->SetArrowPaintType(views::BubbleBorder::PAINT_NONE); | 518 profile_bubble_->SetArrowPaintType(views::BubbleBorder::PAINT_NONE); |
512 } | 519 } |
513 | 520 |
514 // static | 521 // static |
515 bool ProfileChooserView::IsShowing() { | 522 bool ProfileChooserView::IsShowing() { |
516 return profile_bubble_ != NULL; | 523 return profile_bubble_ != NULL; |
517 } | 524 } |
518 | 525 |
519 // static | 526 // static |
520 ProfileChooserView::ShowingType ProfileChooserView::IsShowingInBrowser( | 527 ProfileChooserView::ShowingType ProfileChooserView::IsShowingInBrowser( |
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1747 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1754 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1748 IncognitoModePrefs::DISABLED; | 1755 IncognitoModePrefs::DISABLED; |
1749 return incognito_available && !browser_->profile()->IsGuestSession(); | 1756 return incognito_available && !browser_->profile()->IsGuestSession(); |
1750 } | 1757 } |
1751 | 1758 |
1752 void ProfileChooserView::PostActionPerformed( | 1759 void ProfileChooserView::PostActionPerformed( |
1753 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1760 ProfileMetrics::ProfileDesktopMenu action_performed) { |
1754 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1761 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
1755 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1762 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
1756 } | 1763 } |
OLD | NEW |