OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/intents/web_intent_choose_service_view_controll
er.h" | 5 #import "chrome/browser/ui/cocoa/intents/web_intent_choose_service_view_controll
er.h" |
6 | 6 |
7 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_control_u
tils.h" | 7 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_control_u
tils.h" |
8 #import "chrome/browser/ui/cocoa/flipped_view.h" | 8 #import "chrome/browser/ui/cocoa/flipped_view.h" |
9 #import "chrome/browser/ui/cocoa/hyperlink_button_cell.h" | 9 #import "chrome/browser/ui/cocoa/hyperlink_button_cell.h" |
10 #import "chrome/browser/ui/constrained_window.h" | 10 #import "chrome/browser/ui/constrained_window.h" |
| 11 #import "chrome/browser/ui/constrained_window_constants.h" |
11 #import "chrome/browser/ui/intents/web_intent_picker.h" | 12 #import "chrome/browser/ui/intents/web_intent_picker.h" |
12 #include "grit/generated_resources.h" | 13 #include "grit/generated_resources.h" |
13 #include "grit/theme_resources.h" | 14 #include "grit/theme_resources.h" |
14 #include "skia/ext/skia_utils_mac.h" | 15 #include "skia/ext/skia_utils_mac.h" |
15 #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" | 16 #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" |
16 #include "ui/base/resource/resource_bundle.h" | 17 #include "ui/base/resource/resource_bundle.h" |
17 #include "ui/base/l10n/l10n_util_mac.h" | 18 #include "ui/base/l10n/l10n_util_mac.h" |
18 | 19 |
19 @interface WebIntentChooseServiceViewController () | 20 @interface WebIntentChooseServiceViewController () |
20 // Resizes the title and message text fields to fit the given width. | 21 // Resizes the title and message text fields to fit the given width. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } | 67 } |
67 | 68 |
68 - (NSButton*)showMoreServicesButton { | 69 - (NSButton*)showMoreServicesButton { |
69 return showMoreServicesButton_; | 70 return showMoreServicesButton_; |
70 } | 71 } |
71 | 72 |
72 - (void)setTitle:(NSString*)title { | 73 - (void)setTitle:(NSString*)title { |
73 [titleTextField_ setAttributedStringValue: | 74 [titleTextField_ setAttributedStringValue: |
74 constrained_window::GetAttributedLabelString( | 75 constrained_window::GetAttributedLabelString( |
75 title, | 76 title, |
76 ConstrainedWindow::kBoldTextFontStyle, | 77 ConstrainedWindowConstants::kBoldTextFontStyle, |
77 NSNaturalTextAlignment, | 78 NSNaturalTextAlignment, |
78 NSLineBreakByWordWrapping)]; | 79 NSLineBreakByWordWrapping)]; |
79 } | 80 } |
80 | 81 |
81 - (void)setMessage:(NSString*)message { | 82 - (void)setMessage:(NSString*)message { |
82 [messageTextField_ setAttributedStringValue: | 83 [messageTextField_ setAttributedStringValue: |
83 constrained_window::GetAttributedLabelString( | 84 constrained_window::GetAttributedLabelString( |
84 message, | 85 message, |
85 ConstrainedWindow::kTextFontStyle, | 86 ConstrainedWindowConstants::kTextFontStyle, |
86 NSNaturalTextAlignment, | 87 NSNaturalTextAlignment, |
87 NSLineBreakByWordWrapping)]; | 88 NSLineBreakByWordWrapping)]; |
88 } | 89 } |
89 | 90 |
90 - (void)setRows:(NSArray*)rows { | 91 - (void)setRows:(NSArray*)rows { |
91 for (NSViewController* row in rows_.get()) | 92 for (NSViewController* row in rows_.get()) |
92 [[row view] removeFromSuperview]; | 93 [[row view] removeFromSuperview]; |
93 rows_.reset([rows retain]); | 94 rows_.reset([rows retain]); |
94 for (NSViewController* row in rows_.get()) | 95 for (NSViewController* row in rows_.get()) |
95 [[self view] addSubview:[row view]]; | 96 [[self view] addSubview:[row view]]; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 messageTextField_]; | 190 messageTextField_]; |
190 } | 191 } |
191 | 192 |
192 frame.size.width -= ConstrainedWindow::GetCloseButtonSize() + | 193 frame.size.width -= ConstrainedWindow::GetCloseButtonSize() + |
193 WebIntentPicker::kIconTextPadding; | 194 WebIntentPicker::kIconTextPadding; |
194 [titleTextField_ setFrame:frame]; | 195 [titleTextField_ setFrame:frame]; |
195 [GTMUILocalizerAndLayoutTweaker sizeToFitFixedWidthTextField:titleTextField_]; | 196 [GTMUILocalizerAndLayoutTweaker sizeToFitFixedWidthTextField:titleTextField_]; |
196 } | 197 } |
197 | 198 |
198 @end | 199 @end |
OLD | NEW |