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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 | 438 |
439 // ProfileChooserView --------------------------------------------------------- | 439 // ProfileChooserView --------------------------------------------------------- |
440 | 440 |
441 // static | 441 // static |
442 ProfileChooserView* ProfileChooserView::profile_bubble_ = NULL; | 442 ProfileChooserView* ProfileChooserView::profile_bubble_ = NULL; |
443 bool ProfileChooserView::close_on_deactivate_for_testing_ = true; | 443 bool ProfileChooserView::close_on_deactivate_for_testing_ = true; |
444 | 444 |
445 // static | 445 // static |
446 void ProfileChooserView::ShowBubble( | 446 void ProfileChooserView::ShowBubble( |
447 profiles::BubbleViewMode view_mode, | 447 profiles::BubbleViewMode view_mode, |
448 signin::GAIAServiceType service_type, | 448 const signin::ManageAccountsParams& manage_accounts_params, |
449 views::View* anchor_view, | 449 views::View* anchor_view, |
450 views::BubbleBorder::Arrow arrow, | 450 views::BubbleBorder::Arrow arrow, |
451 views::BubbleBorder::BubbleAlignment border_alignment, | 451 views::BubbleBorder::BubbleAlignment border_alignment, |
452 Browser* browser) { | 452 Browser* browser) { |
453 if (IsShowing()) | 453 if (IsShowing()) |
454 return; | 454 return; |
455 | 455 |
456 profile_bubble_ = new ProfileChooserView(anchor_view, arrow, browser, | 456 profile_bubble_ = new ProfileChooserView(anchor_view, arrow, browser, |
457 view_mode, service_type); | 457 view_mode, manage_accounts_params.service_type); |
458 views::BubbleDelegateView::CreateBubble(profile_bubble_); | 458 views::BubbleDelegateView::CreateBubble(profile_bubble_); |
459 profile_bubble_->set_close_on_deactivate(close_on_deactivate_for_testing_); | 459 profile_bubble_->set_close_on_deactivate(close_on_deactivate_for_testing_); |
460 profile_bubble_->SetAlignment(border_alignment); | 460 profile_bubble_->SetAlignment(border_alignment); |
461 profile_bubble_->GetWidget()->Show(); | 461 profile_bubble_->GetWidget()->Show(); |
462 profile_bubble_->SetArrowPaintType(views::BubbleBorder::PAINT_NONE); | 462 profile_bubble_->SetArrowPaintType(views::BubbleBorder::PAINT_NONE); |
463 } | 463 } |
464 | 464 |
465 // static | 465 // static |
466 bool ProfileChooserView::IsShowing() { | 466 bool ProfileChooserView::IsShowing() { |
467 return profile_bubble_ != NULL; | 467 return profile_bubble_ != NULL; |
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1492 layout->StartRowWithPadding( | 1492 layout->StartRowWithPadding( |
1493 1, 0, 0, views::kUnrelatedControlVerticalSpacing); | 1493 1, 0, 0, views::kUnrelatedControlVerticalSpacing); |
1494 layout->AddView(end_preview_and_relaunch_button_); | 1494 layout->AddView(end_preview_and_relaunch_button_); |
1495 | 1495 |
1496 TitleCard* title_card = new TitleCard( | 1496 TitleCard* title_card = new TitleCard( |
1497 IDS_PROFILES_END_PREVIEW, this, &end_preview_cancel_button_); | 1497 IDS_PROFILES_END_PREVIEW, this, &end_preview_cancel_button_); |
1498 return TitleCard::AddPaddedTitleCard( | 1498 return TitleCard::AddPaddedTitleCard( |
1499 view, title_card, kFixedAccountRemovalViewWidth); | 1499 view, title_card, kFixedAccountRemovalViewWidth); |
1500 } | 1500 } |
1501 | 1501 |
OLD | NEW |