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

Side by Side Diff: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm

Issue 338093004: New avatar menu cleanup: Move supervised user disclaimer into appropriate position. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/profiles/profile_chooser_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" 7 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h"
8 8
9 #include "base/mac/bundle_locations.h" 9 #include "base/mac/bundle_locations.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 for (NSView *otherProfileView in otherProfiles.get()) { 1008 for (NSView *otherProfileView in otherProfiles.get()) {
1009 [otherProfileView setFrameOrigin:NSMakePoint(0, yOffset)]; 1009 [otherProfileView setFrameOrigin:NSMakePoint(0, yOffset)];
1010 [container addSubview:otherProfileView]; 1010 [container addSubview:otherProfileView];
1011 yOffset = NSMaxY([otherProfileView frame]); 1011 yOffset = NSMaxY([otherProfileView frame]);
1012 1012
1013 NSBox* separator = 1013 NSBox* separator =
1014 [self separatorWithFrame:NSMakeRect(0, yOffset, kFixedMenuWidth, 0)]; 1014 [self separatorWithFrame:NSMakeRect(0, yOffset, kFixedMenuWidth, 0)];
1015 [container addSubview:separator]; 1015 [container addSubview:separator];
1016 yOffset = NSMaxY([separator frame]); 1016 yOffset = NSMaxY([separator frame]);
1017 } 1017 }
1018 } else if (viewMode_ == profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT) {
1019 NSView* currentProfileAccountsView = [self createCurrentProfileAccountsView:
1020 NSMakeRect(0, yOffset, kFixedMenuWidth, 0)];
1021 [container addSubview:currentProfileAccountsView];
1022 yOffset = NSMaxY([currentProfileAccountsView frame]);
1023
1024 NSBox* accountsSeparator = [self separatorWithFrame:
1025 NSMakeRect(0, yOffset, kFixedMenuWidth, 0)];
1026 [container addSubview:accountsSeparator];
1027 yOffset = NSMaxY([accountsSeparator frame]);
1028 } 1018 }
1029 1019
1030 // For supervised users, add the disclaimer text. 1020 // For supervised users, add the disclaimer text.
1031 if (browser_->profile()->IsSupervised()) { 1021 if (browser_->profile()->IsSupervised()) {
1032 yOffset += kSmallVerticalSpacing; 1022 yOffset += kSmallVerticalSpacing;
1033 NSView* disclaimerContainer = [self createSupervisedUserDisclaimerView]; 1023 NSView* disclaimerContainer = [self createSupervisedUserDisclaimerView];
1034 [disclaimerContainer setFrameOrigin:NSMakePoint(0, yOffset)]; 1024 [disclaimerContainer setFrameOrigin:NSMakePoint(0, yOffset)];
1035 [container addSubview:disclaimerContainer]; 1025 [container addSubview:disclaimerContainer];
1036 yOffset = NSMaxY([disclaimerContainer frame]); 1026 yOffset = NSMaxY([disclaimerContainer frame]);
1037 yOffset += kSmallVerticalSpacing; 1027 yOffset += kSmallVerticalSpacing;
1038 1028
1039 NSBox* separator = 1029 NSBox* separator =
1040 [self separatorWithFrame:NSMakeRect(0, yOffset, kFixedMenuWidth, 0)]; 1030 [self separatorWithFrame:NSMakeRect(0, yOffset, kFixedMenuWidth, 0)];
1041 [container addSubview:separator]; 1031 [container addSubview:separator];
1042 yOffset = NSMaxY([separator frame]); 1032 yOffset = NSMaxY([separator frame]);
1043 } 1033 }
1044 1034
1035 if (viewMode_ == profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT) {
1036 NSView* currentProfileAccountsView = [self createCurrentProfileAccountsView:
1037 NSMakeRect(0, yOffset, kFixedMenuWidth, 0)];
1038 [container addSubview:currentProfileAccountsView];
1039 yOffset = NSMaxY([currentProfileAccountsView frame]);
1040
1041 NSBox* accountsSeparator = [self separatorWithFrame:
1042 NSMakeRect(0, yOffset, kFixedMenuWidth, 0)];
1043 [container addSubview:accountsSeparator];
1044 yOffset = NSMaxY([accountsSeparator frame]);
1045 }
1046
1045 // Active profile card. 1047 // Active profile card.
1046 if (currentProfileView) { 1048 if (currentProfileView) {
1047 yOffset += kVerticalSpacing; 1049 yOffset += kVerticalSpacing;
1048 [currentProfileView setFrameOrigin:NSMakePoint(0, yOffset)]; 1050 [currentProfileView setFrameOrigin:NSMakePoint(0, yOffset)];
1049 [container addSubview:currentProfileView]; 1051 [container addSubview:currentProfileView];
1050 yOffset = NSMaxY([currentProfileView frame]) + kVerticalSpacing; 1052 yOffset = NSMaxY([currentProfileView frame]) + kVerticalSpacing;
1051 } 1053 }
1052 1054
1053 if (tutorialView) { 1055 if (tutorialView) {
1054 [tutorialView setFrameOrigin:NSMakePoint(0, yOffset)]; 1056 [tutorialView setFrameOrigin:NSMakePoint(0, yOffset)];
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
1783 [button addSubview:deleteButton]; 1785 [button addSubview:deleteButton];
1784 return button.autorelease(); 1786 return button.autorelease();
1785 } 1787 }
1786 1788
1787 - (void)postActionPerformed:(ProfileMetrics::ProfileDesktopMenu)action { 1789 - (void)postActionPerformed:(ProfileMetrics::ProfileDesktopMenu)action {
1788 ProfileMetrics::LogProfileDesktopMenu(action, serviceType_); 1790 ProfileMetrics::LogProfileDesktopMenu(action, serviceType_);
1789 serviceType_ = signin::GAIA_SERVICE_TYPE_NONE; 1791 serviceType_ = signin::GAIA_SERVICE_TYPE_NONE;
1790 } 1792 }
1791 1793
1792 @end 1794 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/profiles/profile_chooser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698