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 18 matching lines...) Expand all Loading... |
29 #include "chrome/browser/signin/signin_manager_factory.h" | 29 #include "chrome/browser/signin/signin_manager_factory.h" |
30 #include "chrome/browser/signin/signin_promo.h" | 30 #include "chrome/browser/signin/signin_promo.h" |
31 #include "chrome/browser/signin/signin_ui_util.h" | 31 #include "chrome/browser/signin/signin_ui_util.h" |
32 #include "chrome/browser/ui/browser.h" | 32 #include "chrome/browser/ui/browser.h" |
33 #include "chrome/browser/ui/browser_commands.h" | 33 #include "chrome/browser/ui/browser_commands.h" |
34 #include "chrome/browser/ui/browser_window.h" | 34 #include "chrome/browser/ui/browser_window.h" |
35 #include "chrome/browser/ui/chrome_pages.h" | 35 #include "chrome/browser/ui/chrome_pages.h" |
36 #include "chrome/browser/ui/chrome_style.h" | 36 #include "chrome/browser/ui/chrome_style.h" |
37 #import "chrome/browser/ui/cocoa/info_bubble_view.h" | 37 #import "chrome/browser/ui/cocoa/info_bubble_view.h" |
38 #import "chrome/browser/ui/cocoa/info_bubble_window.h" | 38 #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
| 39 #import "chrome/browser/ui/cocoa/key_equivalent_constants.h" |
39 #import "chrome/browser/ui/cocoa/profiles/user_manager_mac.h" | 40 #import "chrome/browser/ui/cocoa/profiles/user_manager_mac.h" |
40 #include "chrome/browser/ui/singleton_tabs.h" | 41 #include "chrome/browser/ui/singleton_tabs.h" |
41 #include "chrome/browser/ui/user_manager.h" | 42 #include "chrome/browser/ui/user_manager.h" |
42 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 43 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
43 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 44 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
44 #include "chrome/common/pref_names.h" | 45 #include "chrome/common/pref_names.h" |
45 #include "chrome/common/url_constants.h" | 46 #include "chrome/common/url_constants.h" |
46 #include "chrome/grit/chromium_strings.h" | 47 #include "chrome/grit/chromium_strings.h" |
47 #include "chrome/grit/generated_resources.h" | 48 #include "chrome/grit/generated_resources.h" |
48 #include "components/signin/core/browser/mutable_profile_oauth2_token_service.h" | 49 #include "components/signin/core/browser/mutable_profile_oauth2_token_service.h" |
(...skipping 2044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2093 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 2094 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
2094 NSImage* image = rb->GetNativeImageNamed(imageResourceId).ToNSImage(); | 2095 NSImage* image = rb->GetNativeImageNamed(imageResourceId).ToNSImage(); |
2095 [button setDefaultImage:image]; | 2096 [button setDefaultImage:image]; |
2096 [button setHoverImage:image]; | 2097 [button setHoverImage:image]; |
2097 [button setPressedImage:image]; | 2098 [button setPressedImage:image]; |
2098 [button setImagePosition:NSImageLeft]; | 2099 [button setImagePosition:NSImageLeft]; |
2099 [button setAlignment:NSLeftTextAlignment]; | 2100 [button setAlignment:NSLeftTextAlignment]; |
2100 [button setBordered:NO]; | 2101 [button setBordered:NO]; |
2101 [button setTarget:self]; | 2102 [button setTarget:self]; |
2102 [button setAction:action]; | 2103 [button setAction:action]; |
| 2104 [button setKeyEquivalent:kKeyEquivalentReturn]; |
2103 | 2105 |
2104 return button.autorelease(); | 2106 return button.autorelease(); |
2105 } | 2107 } |
2106 | 2108 |
2107 - (NSButton*)linkButtonWithTitle:(NSString*)title | 2109 - (NSButton*)linkButtonWithTitle:(NSString*)title |
2108 frameOrigin:(NSPoint)frameOrigin | 2110 frameOrigin:(NSPoint)frameOrigin |
2109 action:(SEL)action { | 2111 action:(SEL)action { |
2110 base::scoped_nsobject<NSButton> link( | 2112 base::scoped_nsobject<NSButton> link( |
2111 [[HyperlinkButtonCell buttonWithString:title] retain]); | 2113 [[HyperlinkButtonCell buttonWithString:title] retain]); |
2112 | 2114 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2192 } | 2194 } |
2193 | 2195 |
2194 - (bool)shouldShowGoIncognito { | 2196 - (bool)shouldShowGoIncognito { |
2195 bool incognitoAvailable = | 2197 bool incognitoAvailable = |
2196 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 2198 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
2197 IncognitoModePrefs::DISABLED; | 2199 IncognitoModePrefs::DISABLED; |
2198 return incognitoAvailable && !browser_->profile()->IsGuestSession(); | 2200 return incognitoAvailable && !browser_->profile()->IsGuestSession(); |
2199 } | 2201 } |
2200 | 2202 |
2201 @end | 2203 @end |
OLD | NEW |