OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/bookmarks/bookmark_sync_promo_controller.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_sync_promo_controller.h" |
6 | 6 |
7 #include "base/strings/sys_string_conversions.h" | 7 #include "base/strings/sys_string_conversions.h" |
8 #include "chrome/browser/signin/signin_promo.h" | 8 #include "chrome/browser/signin/signin_promo.h" |
9 #include "chrome/browser/ui/chrome_pages.h" | 9 #include "chrome/browser/ui/chrome_pages.h" |
10 #include "chrome/browser/ui/chrome_style.h" | 10 #include "chrome/browser/ui/chrome_style.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 NSColor* linkColor = gfx::SkColorToCalibratedNSColor( | 89 NSColor* linkColor = gfx::SkColorToCalibratedNSColor( |
90 chrome_style::GetLinkColor()); | 90 chrome_style::GetLinkColor()); |
91 | 91 |
92 textView_.reset([[HyperlinkTextView alloc] init]); | 92 textView_.reset([[HyperlinkTextView alloc] init]); |
93 [textView_ setMessageAndLink:base::SysUTF16ToNSString(promoTextWithoutLink) | 93 [textView_ setMessageAndLink:base::SysUTF16ToNSString(promoTextWithoutLink) |
94 withLink:base::SysUTF16ToNSString(linkText) | 94 withLink:base::SysUTF16ToNSString(linkText) |
95 atOffset:offset | 95 atOffset:offset |
96 font:font | 96 font:font |
97 messageColor:gfx::SkColorToDeviceNSColor(kTextColor) | 97 messageColor:gfx::SkColorToDeviceNSColor(kTextColor) |
98 linkColor:linkColor]; | 98 linkColor:linkColor]; |
99 [textView_ setAcceptsFirstResponder:NO]; | 99 [textView_ setRefusesFirstResponder:YES]; |
100 [[textView_ textContainer] setLineFragmentPadding:0.0]; | 100 [[textView_ textContainer] setLineFragmentPadding:0.0]; |
101 RemoveUnderlining(textView_, offset, linkText.size()); | 101 RemoveUnderlining(textView_, offset, linkText.size()); |
102 [textView_ setDelegate:self]; | 102 [textView_ setDelegate:self]; |
103 | 103 |
104 [promoView setContentView:textView_]; | 104 [promoView setContentView:textView_]; |
105 | 105 |
106 [self setView:promoView]; | 106 [self setView:promoView]; |
107 } | 107 } |
108 | 108 |
109 - (BOOL)textView:(NSTextView *)textView | 109 - (BOOL)textView:(NSTextView *)textView |
110 clickedOnLink:(id)link | 110 clickedOnLink:(id)link |
111 atIndex:(NSUInteger)charIndex { | 111 atIndex:(NSUInteger)charIndex { |
112 chrome::ShowBrowserSignin(browser_, signin::SOURCE_BOOKMARK_BUBBLE); | 112 chrome::ShowBrowserSignin(browser_, signin::SOURCE_BOOKMARK_BUBBLE); |
113 return YES; | 113 return YES; |
114 } | 114 } |
115 | 115 |
116 @end | 116 @end |
OLD | NEW |