Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Side by Side Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 1136693002: Chrome user menu shouldn't close if a tab steals focus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chrome user menu shouldn't close if a tab steals focus Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_VIEW); 679 ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_VIEW);
680 break; 680 break;
681 default: 681 default:
682 layout = CreateSingleColumnLayout(this, kFixedMenuWidth); 682 layout = CreateSingleColumnLayout(this, kFixedMenuWidth);
683 sub_view = CreateProfileChooserView(avatar_menu); 683 sub_view = CreateProfileChooserView(avatar_menu);
684 } 684 }
685 // Clears tutorial mode for all non-profile-chooser views. 685 // Clears tutorial mode for all non-profile-chooser views.
686 if (view_mode_ != profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER) 686 if (view_mode_ != profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER)
687 tutorial_mode_ = profiles::TUTORIAL_MODE_NONE; 687 tutorial_mode_ = profiles::TUTORIAL_MODE_NONE;
688 688
689 if (view_mode_ == profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN ||
690 view_mode_ == profiles::BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT ||
691 view_mode_ == profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH ||
692 tutorial_mode_ == profiles::TUTORIAL_MODE_CONFIRM_SIGNIN) {
693 profile_bubble_->set_close_on_deactivate(false);
694 } else
695 profile_bubble_->set_close_on_deactivate(close_on_deactivate_for_testing_);
Roger Tawa OOO till Jul 10th 2015/05/14 18:55:03 If you added { and } to the if block, you also nee
gogerald1 2015/05/14 21:35:22 Done.
696
689 layout->StartRow(1, 0); 697 layout->StartRow(1, 0);
690 layout->AddView(sub_view); 698 layout->AddView(sub_view);
691 Layout(); 699 Layout();
692 if (GetBubbleFrameView()) 700 if (GetBubbleFrameView())
693 SizeToContents(); 701 SizeToContents();
694 } 702 }
695 703
696 void ProfileChooserView::WindowClosing() { 704 void ProfileChooserView::WindowClosing() {
697 DCHECK_EQ(profile_bubble_, this); 705 DCHECK_EQ(profile_bubble_, this);
698 profile_bubble_ = NULL; 706 profile_bubble_ = NULL;
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1704 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != 1712 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) !=
1705 IncognitoModePrefs::DISABLED; 1713 IncognitoModePrefs::DISABLED;
1706 return incognito_available && !browser_->profile()->IsGuestSession(); 1714 return incognito_available && !browser_->profile()->IsGuestSession();
1707 } 1715 }
1708 1716
1709 void ProfileChooserView::PostActionPerformed( 1717 void ProfileChooserView::PostActionPerformed(
1710 ProfileMetrics::ProfileDesktopMenu action_performed) { 1718 ProfileMetrics::ProfileDesktopMenu action_performed) {
1711 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); 1719 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_);
1712 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; 1720 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE;
1713 } 1721 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698