| 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 | 423 |
| 424 // ProfileChooserView --------------------------------------------------------- | 424 // ProfileChooserView --------------------------------------------------------- |
| 425 | 425 |
| 426 // static | 426 // static |
| 427 ProfileChooserView* ProfileChooserView::profile_bubble_ = NULL; | 427 ProfileChooserView* ProfileChooserView::profile_bubble_ = NULL; |
| 428 bool ProfileChooserView::close_on_deactivate_for_testing_ = true; | 428 bool ProfileChooserView::close_on_deactivate_for_testing_ = true; |
| 429 | 429 |
| 430 // static | 430 // static |
| 431 void ProfileChooserView::ShowBubble( | 431 void ProfileChooserView::ShowBubble( |
| 432 profiles::BubbleViewMode view_mode, | 432 profiles::BubbleViewMode view_mode, |
| 433 signin::GAIAServiceType service_type, | 433 const signin::ManageAccountsParams& manage_accounts_params, |
| 434 views::View* anchor_view, | 434 views::View* anchor_view, |
| 435 views::BubbleBorder::Arrow arrow, | 435 views::BubbleBorder::Arrow arrow, |
| 436 views::BubbleBorder::BubbleAlignment border_alignment, | 436 views::BubbleBorder::BubbleAlignment border_alignment, |
| 437 const gfx::Rect& anchor_rect, | 437 const gfx::Rect& anchor_rect, |
| 438 Browser* browser) { | 438 Browser* browser) { |
| 439 if (IsShowing()) | 439 if (IsShowing()) |
| 440 return; | 440 return; |
| 441 | 441 |
| 442 profile_bubble_ = new ProfileChooserView(anchor_view, arrow, anchor_rect, | 442 profile_bubble_ = new ProfileChooserView(anchor_view, arrow, anchor_rect, |
| 443 browser, view_mode, service_type); | 443 browser, view_mode, manage_accounts_params.service_type); |
| 444 views::BubbleDelegateView::CreateBubble(profile_bubble_); | 444 views::BubbleDelegateView::CreateBubble(profile_bubble_); |
| 445 profile_bubble_->set_close_on_deactivate(close_on_deactivate_for_testing_); | 445 profile_bubble_->set_close_on_deactivate(close_on_deactivate_for_testing_); |
| 446 profile_bubble_->SetAlignment(border_alignment); | 446 profile_bubble_->SetAlignment(border_alignment); |
| 447 profile_bubble_->GetWidget()->Show(); | 447 profile_bubble_->GetWidget()->Show(); |
| 448 profile_bubble_->SetArrowPaintType(views::BubbleBorder::PAINT_NONE); | 448 profile_bubble_->SetArrowPaintType(views::BubbleBorder::PAINT_NONE); |
| 449 } | 449 } |
| 450 | 450 |
| 451 // static | 451 // static |
| 452 bool ProfileChooserView::IsShowing() { | 452 bool ProfileChooserView::IsShowing() { |
| 453 return profile_bubble_ != NULL; | 453 return profile_bubble_ != NULL; |
| (...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1474 layout->StartRowWithPadding( | 1474 layout->StartRowWithPadding( |
| 1475 1, 0, 0, views::kUnrelatedControlVerticalSpacing); | 1475 1, 0, 0, views::kUnrelatedControlVerticalSpacing); |
| 1476 layout->AddView(end_preview_and_relaunch_button_); | 1476 layout->AddView(end_preview_and_relaunch_button_); |
| 1477 | 1477 |
| 1478 TitleCard* title_card = new TitleCard( | 1478 TitleCard* title_card = new TitleCard( |
| 1479 IDS_PROFILES_END_PREVIEW, this, &end_preview_cancel_button_); | 1479 IDS_PROFILES_END_PREVIEW, this, &end_preview_cancel_button_); |
| 1480 return TitleCard::AddPaddedTitleCard( | 1480 return TitleCard::AddPaddedTitleCard( |
| 1481 view, title_card, kFixedAccountRemovalViewWidth); | 1481 view, title_card, kFixedAccountRemovalViewWidth); |
| 1482 } | 1482 } |
| 1483 | 1483 |
| OLD | NEW |