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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 @interface DummyWindowFocusButton : NSButton | 766 @interface DummyWindowFocusButton : NSButton |
767 @end | 767 @end |
768 | 768 |
769 @implementation DummyWindowFocusButton | 769 @implementation DummyWindowFocusButton |
770 // Ignore accessibility, as this is a placeholder button. | 770 // Ignore accessibility, as this is a placeholder button. |
771 - (BOOL)accessibilityIsIgnored { | 771 - (BOOL)accessibilityIsIgnored { |
772 return YES; | 772 return YES; |
773 } | 773 } |
774 | 774 |
775 - (id)accessibilityAttributeValue:(NSString*)attribute { | 775 - (id)accessibilityAttributeValue:(NSString*)attribute { |
776 return @[]; | 776 return nil; |
777 } | 777 } |
778 | 778 |
779 - (BOOL)canBecomeKeyView { | 779 - (BOOL)canBecomeKeyView { |
780 return false; | 780 return false; |
781 } | 781 } |
782 | 782 |
783 @end | 783 @end |
784 | 784 |
785 @interface ProfileChooserController () | 785 @interface ProfileChooserController () |
786 // Builds the profile chooser view. | 786 // Builds the profile chooser view. |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 break; | 1145 break; |
1146 } | 1146 } |
1147 | 1147 |
1148 // Clears tutorial mode for all non-profile-chooser views. | 1148 // Clears tutorial mode for all non-profile-chooser views. |
1149 if (viewMode_ != profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER) | 1149 if (viewMode_ != profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER) |
1150 tutorialMode_ = profiles::TUTORIAL_MODE_NONE; | 1150 tutorialMode_ = profiles::TUTORIAL_MODE_NONE; |
1151 | 1151 |
1152 // Add a dummy, empty element so that we don't initially display any | 1152 // Add a dummy, empty element so that we don't initially display any |
1153 // focus rings. | 1153 // focus rings. |
1154 NSButton* dummyFocusButton = | 1154 NSButton* dummyFocusButton = |
1155 [[[DummyWindowFocusButton alloc] initWithFrame:NSZeroRect] autorelease]; | 1155 [[[DummyWindowFocusButton alloc] initWithFrame:NSZeroRect] autorelease]; |
1156 [dummyFocusButton setNextKeyView:subView]; | 1156 [dummyFocusButton setNextKeyView:subView]; |
1157 [[self window] makeFirstResponder:dummyFocusButton]; | 1157 [[self window] makeFirstResponder:dummyFocusButton]; |
1158 | 1158 |
1159 [contentView addSubview:subView]; | 1159 [contentView addSubview:subView]; |
1160 [contentView addSubview:dummyFocusButton]; | 1160 [contentView addSubview:dummyFocusButton]; |
1161 SetWindowSize([self window], | 1161 SetWindowSize([self window], |
1162 NSMakeSize(NSWidth([subView frame]), NSHeight([subView frame]))); | 1162 NSMakeSize(NSWidth([subView frame]), NSHeight([subView frame]))); |
1163 } | 1163 } |
1164 | 1164 |
1165 - (NSView*)buildProfileChooserView { | 1165 - (NSView*)buildProfileChooserView { |
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2192 } | 2192 } |
2193 | 2193 |
2194 - (bool)shouldShowGoIncognito { | 2194 - (bool)shouldShowGoIncognito { |
2195 bool incognitoAvailable = | 2195 bool incognitoAvailable = |
2196 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 2196 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
2197 IncognitoModePrefs::DISABLED; | 2197 IncognitoModePrefs::DISABLED; |
2198 return incognitoAvailable && !browser_->profile()->IsGuestSession(); | 2198 return incognitoAvailable && !browser_->profile()->IsGuestSession(); |
2199 } | 2199 } |
2200 | 2200 |
2201 @end | 2201 @end |
OLD | NEW |