| 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 | 9 |
| 10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 #import "ui/base/cocoa/controls/hyperlink_text_view.h" | 65 #import "ui/base/cocoa/controls/hyperlink_text_view.h" |
| 66 #import "ui/base/cocoa/hover_image_button.h" | 66 #import "ui/base/cocoa/hover_image_button.h" |
| 67 #include "ui/base/cocoa/window_size_constants.h" | 67 #include "ui/base/cocoa/window_size_constants.h" |
| 68 #include "ui/base/l10n/l10n_util.h" | 68 #include "ui/base/l10n/l10n_util.h" |
| 69 #include "ui/base/l10n/l10n_util_mac.h" | 69 #include "ui/base/l10n/l10n_util_mac.h" |
| 70 #include "ui/base/resource/resource_bundle.h" | 70 #include "ui/base/resource/resource_bundle.h" |
| 71 #include "ui/gfx/image/image.h" | 71 #include "ui/gfx/image/image.h" |
| 72 #include "ui/gfx/text_elider.h" | 72 #include "ui/gfx/text_elider.h" |
| 73 #include "ui/native_theme/common_theme.h" | 73 #include "ui/native_theme/common_theme.h" |
| 74 #include "ui/native_theme/native_theme.h" | 74 #include "ui/native_theme/native_theme.h" |
| 75 #include "ui/native_theme/native_theme_mac.h" |
| 75 | 76 |
| 76 namespace { | 77 namespace { |
| 77 | 78 |
| 78 // Constants taken from the Windows/Views implementation at: | 79 // Constants taken from the Windows/Views implementation at: |
| 79 // chrome/browser/ui/views/profile_chooser_view.cc | 80 // chrome/browser/ui/views/profile_chooser_view.cc |
| 80 const int kLargeImageSide = 88; | 81 const int kLargeImageSide = 88; |
| 81 const int kSmallImageSide = 32; | 82 const int kSmallImageSide = 32; |
| 82 const CGFloat kFixedMenuWidth = 250; | 83 const CGFloat kFixedMenuWidth = 250; |
| 83 | 84 |
| 84 const CGFloat kVerticalSpacing = 16.0; | 85 const CGFloat kVerticalSpacing = 16.0; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 options:NSStringDrawingUsesLineFragmentOrigin]; | 192 options:NSStringDrawingUsesLineFragmentOrigin]; |
| 192 frame.origin = frame_origin; | 193 frame.origin = frame_origin; |
| 193 [text_view setFrame:frame]; | 194 [text_view setFrame:frame]; |
| 194 [text_view setDelegate:delegate]; | 195 [text_view setDelegate:delegate]; |
| 195 return text_view.autorelease(); | 196 return text_view.autorelease(); |
| 196 } | 197 } |
| 197 | 198 |
| 198 // Returns the native dialog background color. | 199 // Returns the native dialog background color. |
| 199 NSColor* GetDialogBackgroundColor() { | 200 NSColor* GetDialogBackgroundColor() { |
| 200 return gfx::SkColorToCalibratedNSColor( | 201 return gfx::SkColorToCalibratedNSColor( |
| 201 ui::NativeTheme::instance()->GetSystemColor( | 202 ui::NativeThemeMac::instance()->GetSystemColor( |
| 202 ui::NativeTheme::kColorId_DialogBackground)); | 203 ui::NativeTheme::kColorId_DialogBackground)); |
| 203 } | 204 } |
| 204 | 205 |
| 205 // Builds a title card with one back button right aligned and one label center | 206 // Builds a title card with one back button right aligned and one label center |
| 206 // aligned. | 207 // aligned. |
| 207 NSView* BuildTitleCard(NSRect frame_rect, | 208 NSView* BuildTitleCard(NSRect frame_rect, |
| 208 const base::string16& message, | 209 const base::string16& message, |
| 209 id back_button_target, | 210 id back_button_target, |
| 210 SEL back_button_action) { | 211 SEL back_button_action) { |
| 211 base::scoped_nsobject<NSView> container( | 212 base::scoped_nsobject<NSView> container( |
| (...skipping 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2404 } | 2405 } |
| 2405 | 2406 |
| 2406 - (bool)shouldShowGoIncognito { | 2407 - (bool)shouldShowGoIncognito { |
| 2407 bool incognitoAvailable = | 2408 bool incognitoAvailable = |
| 2408 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 2409 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 2409 IncognitoModePrefs::DISABLED; | 2410 IncognitoModePrefs::DISABLED; |
| 2410 return incognitoAvailable && !browser_->profile()->IsGuestSession(); | 2411 return incognitoAvailable && !browser_->profile()->IsGuestSession(); |
| 2411 } | 2412 } |
| 2412 | 2413 |
| 2413 @end | 2414 @end |
| OLD | NEW |