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 "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" | 5 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" |
6 | 6 |
7 #import <Carbon/Carbon.h> // kVK_Return. | 7 #import <Carbon/Carbon.h> // kVK_Return. |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #include "chrome/grit/theme_resources.h" | 59 #include "chrome/grit/theme_resources.h" |
60 #include "components/browser_sync/profile_sync_service.h" | 60 #include "components/browser_sync/profile_sync_service.h" |
61 #include "components/prefs/pref_service.h" | 61 #include "components/prefs/pref_service.h" |
62 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 62 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
63 #include "components/signin/core/browser/signin_manager.h" | 63 #include "components/signin/core/browser/signin_manager.h" |
64 #include "components/signin/core/browser/signin_metrics.h" | 64 #include "components/signin/core/browser/signin_metrics.h" |
65 #include "components/signin/core/common/profile_management_switches.h" | 65 #include "components/signin/core/common/profile_management_switches.h" |
66 #include "content/public/browser/native_web_keyboard_event.h" | 66 #include "content/public/browser/native_web_keyboard_event.h" |
67 #include "content/public/browser/notification_service.h" | 67 #include "content/public/browser/notification_service.h" |
68 #include "content/public/browser/render_widget_host_view.h" | 68 #include "content/public/browser/render_widget_host_view.h" |
69 #include "content/public/browser/user_metrics.h" | |
70 #include "content/public/browser/web_contents.h" | 69 #include "content/public/browser/web_contents.h" |
71 #include "google_apis/gaia/oauth2_token_service.h" | 70 #include "google_apis/gaia/oauth2_token_service.h" |
72 #include "skia/ext/skia_utils_mac.h" | 71 #include "skia/ext/skia_utils_mac.h" |
73 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTw
eaker.h" | 72 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTw
eaker.h" |
74 #import "ui/base/cocoa/cocoa_base_utils.h" | 73 #import "ui/base/cocoa/cocoa_base_utils.h" |
75 #import "ui/base/cocoa/controls/blue_label_button.h" | 74 #import "ui/base/cocoa/controls/blue_label_button.h" |
76 #import "ui/base/cocoa/controls/hyperlink_button_cell.h" | 75 #import "ui/base/cocoa/controls/hyperlink_button_cell.h" |
77 #import "ui/base/cocoa/controls/hyperlink_text_view.h" | 76 #import "ui/base/cocoa/controls/hyperlink_text_view.h" |
78 #import "ui/base/cocoa/hover_image_button.h" | 77 #import "ui/base/cocoa/hover_image_button.h" |
79 #include "ui/base/cocoa/window_size_constants.h" | 78 #include "ui/base/cocoa/window_size_constants.h" |
(...skipping 2011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2091 if (kRightPadding >= 8) | 2090 if (kRightPadding >= 8) |
2092 rect.size.width += 8; // Re-stretch a little bit to fit promo text. | 2091 rect.size.width += 8; // Re-stretch a little bit to fit promo text. |
2093 DCHECK(kRightPadding >= 8); | 2092 DCHECK(kRightPadding >= 8); |
2094 [promo setFrameSize:NSMakeSize(rect.size.width, 0)]; | 2093 [promo setFrameSize:NSMakeSize(rect.size.width, 0)]; |
2095 [GTMUILocalizerAndLayoutTweaker sizeToFitFixedWidthTextField:promo]; | 2094 [GTMUILocalizerAndLayoutTweaker sizeToFitFixedWidthTextField:promo]; |
2096 [container addSubview:promo]; | 2095 [container addSubview:promo]; |
2097 | 2096 |
2098 [container setFrameSize:NSMakeSize(rect.size.width, | 2097 [container setFrameSize:NSMakeSize(rect.size.width, |
2099 NSMaxY([promo frame]) + | 2098 NSMaxY([promo frame]) + |
2100 kRelatedControllVerticalSpacing)]; | 2099 kRelatedControllVerticalSpacing)]; |
2101 content::RecordAction( | 2100 base::RecordAction( |
2102 base::UserMetricsAction("Signin_Impression_FromAvatarBubbleSignin")); | 2101 base::UserMetricsAction("Signin_Impression_FromAvatarBubbleSignin")); |
2103 } | 2102 } |
2104 | 2103 |
2105 return container.autorelease(); | 2104 return container.autorelease(); |
2106 } | 2105 } |
2107 | 2106 |
2108 - (NSView*)createSupervisedUserDisclaimerView { | 2107 - (NSView*)createSupervisedUserDisclaimerView { |
2109 base::scoped_nsobject<NSView> container( | 2108 base::scoped_nsobject<NSView> container( |
2110 [[NSView alloc] initWithFrame:NSZeroRect]); | 2109 [[NSView alloc] initWithFrame:NSZeroRect]); |
2111 | 2110 |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2676 | 2675 |
2677 - (void)showWindow:(id)sender { | 2676 - (void)showWindow:(id)sender { |
2678 [super showWindow:sender]; | 2677 [super showWindow:sender]; |
2679 NSEvent *event = [[NSApplication sharedApplication] currentEvent]; | 2678 NSEvent *event = [[NSApplication sharedApplication] currentEvent]; |
2680 if (firstProfileView_ && [event type] == NSKeyDown) { | 2679 if (firstProfileView_ && [event type] == NSKeyDown) { |
2681 [[self window] makeFirstResponder:firstProfileView_]; | 2680 [[self window] makeFirstResponder:firstProfileView_]; |
2682 } | 2681 } |
2683 } | 2682 } |
2684 | 2683 |
2685 @end | 2684 @end |
OLD | NEW |