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 #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 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
808 - (IBAction)removeAccount:(id)sender { | 808 - (IBAction)removeAccount:(id)sender { |
809 DCHECK(!accountIdToRemove_.empty()); | 809 DCHECK(!accountIdToRemove_.empty()); |
810 ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile( | 810 ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile( |
811 browser_->profile())->RevokeCredentials(accountIdToRemove_); | 811 browser_->profile())->RevokeCredentials(accountIdToRemove_); |
812 accountIdToRemove_.clear(); | 812 accountIdToRemove_.clear(); |
813 | 813 |
814 [self initMenuContentsWithView:BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT]; | 814 [self initMenuContentsWithView:BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT]; |
815 } | 815 } |
816 | 816 |
817 - (IBAction)openTutorialLearnMoreURL:(id)sender { | 817 - (IBAction)openTutorialLearnMoreURL:(id)sender { |
818 ProfileMetrics::LogProfileUpgradeEnrollment( | |
819 ProfileMetrics::PROFILE_ENROLLMENT_LAUNCH_LEARN_MORE); | |
818 // TODO(guohui): update |learnMoreUrl| once it is decided. | 820 // TODO(guohui): update |learnMoreUrl| once it is decided. |
819 const GURL learnMoreUrl("https://support.google.com/chrome/?hl=en#to"); | 821 const GURL learnMoreUrl("https://support.google.com/chrome/?hl=en#to"); |
820 chrome::NavigateParams params(browser_->profile(), learnMoreUrl, | 822 chrome::NavigateParams params(browser_->profile(), learnMoreUrl, |
821 content::PAGE_TRANSITION_LINK); | 823 content::PAGE_TRANSITION_LINK); |
822 params.disposition = NEW_FOREGROUND_TAB; | 824 params.disposition = NEW_FOREGROUND_TAB; |
823 chrome::Navigate(¶ms); | 825 chrome::Navigate(¶ms); |
824 } | 826 } |
825 | 827 |
826 - (IBAction)enableNewProfileManagementPreview:(id)sender { | 828 - (IBAction)enableNewProfileManagementPreview:(id)sender { |
829 ProfileMetrics::LogProfileUpgradeEnrollment( | |
830 ProfileMetrics::PROFILE_ENROLLMENT_ACCEPT_NEW_PROFILE_MGMT); | |
827 profiles::EnableNewProfileManagementPreview(); | 831 profiles::EnableNewProfileManagementPreview(); |
828 } | 832 } |
829 | 833 |
830 - (IBAction)dismissTutorial:(id)sender { | 834 - (IBAction)dismissTutorial:(id)sender { |
835 ProfileMetrics::LogProfileUpgradeEnrollment( | |
836 ProfileMetrics::PROFILE_ENROLLMENT_CLOSE_WELCOME_CARD); | |
831 // If the user manually dismissed the tutorial, never show it again by setting | 837 // If the user manually dismissed the tutorial, never show it again by setting |
832 // the number of times shown to the maximum plus 1, so that later we could | 838 // the number of times shown to the maximum plus 1, so that later we could |
833 // distinguish between the dismiss case and the case when the tutorial is | 839 // distinguish between the dismiss case and the case when the tutorial is |
834 // indeed shown for the maximum number of times. | 840 // indeed shown for the maximum number of times. |
835 browser_->profile()->GetPrefs()->SetInteger( | 841 browser_->profile()->GetPrefs()->SetInteger( |
836 prefs::kProfileAvatarTutorialShown, kProfileAvatarTutorialShowMax + 1); | 842 prefs::kProfileAvatarTutorialShown, kProfileAvatarTutorialShowMax + 1); |
837 [self initMenuContentsWithView:BUBBLE_VIEW_MODE_PROFILE_CHOOSER]; | 843 [self initMenuContentsWithView:BUBBLE_VIEW_MODE_PROFILE_CHOOSER]; |
838 } | 844 } |
839 | 845 |
840 - (IBAction)showSendFeedbackTutorial:(id)sender { | 846 - (IBAction)showSendFeedbackTutorial:(id)sender { |
847 ProfileMetrics::LogProfileUpgradeEnrollment( | |
848 ProfileMetrics::PROFILE_ENROLLMENT_SEND_FEEDBACK); | |
841 tutorialMode_ = TUTORIAL_MODE_SEND_FEEDBACK; | 849 tutorialMode_ = TUTORIAL_MODE_SEND_FEEDBACK; |
842 [self initMenuContentsWithView:BUBBLE_VIEW_MODE_PROFILE_CHOOSER]; | 850 [self initMenuContentsWithView:BUBBLE_VIEW_MODE_PROFILE_CHOOSER]; |
843 } | 851 } |
844 | 852 |
845 - (IBAction)showEndPreviewView:(id)sender { | 853 - (IBAction)showEndPreviewView:(id)sender { |
846 [self initMenuContentsWithView:BUBBLE_VIEW_MODE_END_PREVIEW]; | 854 [self initMenuContentsWithView:BUBBLE_VIEW_MODE_END_PREVIEW]; |
847 } | 855 } |
848 | 856 |
849 - (IBAction)sendFeedback:(id)sender { | 857 - (IBAction)sendFeedback:(id)sender { |
850 chrome::OpenFeedbackDialog(browser_); | 858 chrome::OpenFeedbackDialog(browser_); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1005 } else { | 1013 } else { |
1006 tutorialMode_ = TUTORIAL_MODE_NONE; | 1014 tutorialMode_ = TUTORIAL_MODE_NONE; |
1007 } | 1015 } |
1008 | 1016 |
1009 [container setFrameSize:NSMakeSize(kFixedMenuWidth, yOffset)]; | 1017 [container setFrameSize:NSMakeSize(kFixedMenuWidth, yOffset)]; |
1010 return container.autorelease();; | 1018 return container.autorelease();; |
1011 } | 1019 } |
1012 | 1020 |
1013 - (NSView*)buildPreviewTutorialIfNeeded:(const AvatarMenu::Item&)item { | 1021 - (NSView*)buildPreviewTutorialIfNeeded:(const AvatarMenu::Item&)item { |
1014 if (!switches::IsNewProfileManagement()) { | 1022 if (!switches::IsNewProfileManagement()) { |
1023 ProfileMetrics::LogProfileUpgradeEnrollment( | |
1024 ProfileMetrics::PROFILE_ENROLLMENT_SHOW_PREVIEW_PROMO); | |
guohui
2014/05/22 19:43:17
i think this code will double count when the bubbl
Mike Lerman
2014/05/26 18:20:46
Done.
| |
1015 return [self tutorialViewWithMode:TUTORIAL_MODE_ENABLE_PREVIEW | 1025 return [self tutorialViewWithMode:TUTORIAL_MODE_ENABLE_PREVIEW |
1016 titleMessage:IDS_PROFILES_PREVIEW_TUTORIAL_TITLE | 1026 titleMessage:IDS_PROFILES_PREVIEW_TUTORIAL_TITLE |
1017 contentMessage:IDS_PROFILES_PREVIEW_TUTORIAL_CONTENT_TEXT | 1027 contentMessage:IDS_PROFILES_PREVIEW_TUTORIAL_CONTENT_TEXT |
1018 linkMessage:IDS_PROFILES_PROFILE_TUTORIAL_LEARN_MORE | 1028 linkMessage:IDS_PROFILES_PROFILE_TUTORIAL_LEARN_MORE |
1019 buttonMessage:IDS_PROFILES_TUTORIAL_TRY_BUTTON | 1029 buttonMessage:IDS_PROFILES_TUTORIAL_TRY_BUTTON |
1020 linkAction:@selector(openTutorialLearnMoreURL:) | 1030 linkAction:@selector(openTutorialLearnMoreURL:) |
1021 buttonAction: | 1031 buttonAction: |
1022 @selector(enableNewProfileManagementPreview:)]; | 1032 @selector(enableNewProfileManagementPreview:)]; |
1023 } | 1033 } |
1024 | 1034 |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1683 IDR_CLOSE_1_P).ToNSImage()]; | 1693 IDR_CLOSE_1_P).ToNSImage()]; |
1684 [deleteButton setTarget:self]; | 1694 [deleteButton setTarget:self]; |
1685 [deleteButton setAction:@selector(showAccountRemovalView:)]; | 1695 [deleteButton setAction:@selector(showAccountRemovalView:)]; |
1686 [deleteButton setTag:tag]; | 1696 [deleteButton setTag:tag]; |
1687 | 1697 |
1688 [button addSubview:deleteButton]; | 1698 [button addSubview:deleteButton]; |
1689 return button.autorelease(); | 1699 return button.autorelease(); |
1690 } | 1700 } |
1691 | 1701 |
1692 @end | 1702 @end |
OLD | NEW |