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

Side by Side Diff: chrome/browser/ui/views/avatar_menu_bubble_view.cc

Issue 132453004: Add Profile metric counting to new User Manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added new metric information to xml file Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/avatar_menu_bubble_view.h" 5 #include "chrome/browser/ui/views/avatar_menu_bubble_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 profiles::LockProfile(browser_->profile()); 661 profiles::LockProfile(browser_->profile());
662 return; 662 return;
663 } 663 }
664 664
665 for (size_t i = 0; i < item_views_.size(); ++i) { 665 for (size_t i = 0; i < item_views_.size(); ++i) {
666 ProfileItemView* item_view = item_views_[i]; 666 ProfileItemView* item_view = item_views_[i];
667 if (sender == item_view) { 667 if (sender == item_view) {
668 // Clicking on the active profile shouldn't do anything. 668 // Clicking on the active profile shouldn't do anything.
669 if (!item_view->item().active) { 669 if (!item_view->item().active) {
670 avatar_menu_->SwitchToProfile( 670 avatar_menu_->SwitchToProfile(
671 i, ui::DispositionFromEventFlags(event.flags()) == NEW_WINDOW); 671 i,
672 ui::DispositionFromEventFlags(event.flags()) == NEW_WINDOW,
msw 2014/01/29 17:51:58 optional nit: you could wrap this onto the line ab
bcwhite 2014/01/29 19:50:52 Done.
673 ProfileMetrics::SWITCH_PROFILE_ICON);
672 } 674 }
673 break; 675 break;
674 } 676 }
675 } 677 }
676 } 678 }
677 679
678 void AvatarMenuBubbleView::LinkClicked(views::Link* source, int event_flags) { 680 void AvatarMenuBubbleView::LinkClicked(views::Link* source, int event_flags) {
679 if (source == buttons_view_) { 681 if (source == buttons_view_) {
680 avatar_menu_->AddNewProfile(ProfileMetrics::ADD_NEW_USER_ICON); 682 avatar_menu_->AddNewProfile(ProfileMetrics::ADD_NEW_USER_ICON);
681 return; 683 return;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 Layout(); 805 Layout();
804 if (GetBubbleFrameView()) 806 if (GetBubbleFrameView())
805 SizeToContents(); 807 SizeToContents();
806 } 808 }
807 809
808 void AvatarMenuBubbleView::SetBackgroundColors() { 810 void AvatarMenuBubbleView::SetBackgroundColors() {
809 for (size_t i = 0; i < item_views_.size(); ++i) { 811 for (size_t i = 0; i < item_views_.size(); ++i) {
810 item_views_[i]->OnHighlightStateChanged(); 812 item_views_[i]->OnHighlightStateChanged();
811 } 813 }
812 } 814 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698