| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/chooser_content_view_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/chooser_content_view_cocoa.h" |
| 6 | 6 |
| 7 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h" | 7 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h" |
| 8 #include "chrome/grit/generated_resources.h" | 8 #include "chrome/grit/generated_resources.h" |
| 9 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTw
eaker.h" | 9 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTw
eaker.h" |
| 10 #import "ui/base/cocoa/controls/hyperlink_button_cell.h" | 10 #import "ui/base/cocoa/controls/hyperlink_button_cell.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 base::scoped_nsobject<NSButton> button( | 181 base::scoped_nsobject<NSButton> button( |
| 182 [[ConstrainedWindowButton alloc] initWithFrame:NSZeroRect]); | 182 [[ConstrainedWindowButton alloc] initWithFrame:NSZeroRect]); |
| 183 [button setButtonType:NSMomentaryPushInButton]; | 183 [button setButtonType:NSMomentaryPushInButton]; |
| 184 [button setTitle:title]; | 184 [button setTitle:title]; |
| 185 [button sizeToFit]; | 185 [button sizeToFit]; |
| 186 return button; | 186 return button; |
| 187 } | 187 } |
| 188 | 188 |
| 189 - (base::scoped_nsobject<NSButton>)createConnectButton { | 189 - (base::scoped_nsobject<NSButton>)createConnectButton { |
| 190 NSString* connectTitle = | 190 NSString* connectTitle = |
| 191 l10n_util::GetNSString(IDS_CHOOSER_BUBBLE_CONNECT_BUTTON_TEXT); | 191 l10n_util::GetNSString(IDS_DEVICE_CHOOSER_CONNECT_BUTTON_TEXT); |
| 192 return [self createButtonWithTitle:connectTitle]; | 192 return [self createButtonWithTitle:connectTitle]; |
| 193 } | 193 } |
| 194 | 194 |
| 195 - (base::scoped_nsobject<NSButton>)createCancelButton { | 195 - (base::scoped_nsobject<NSButton>)createCancelButton { |
| 196 NSString* cancelTitle = | 196 NSString* cancelTitle = |
| 197 l10n_util::GetNSString(IDS_CHOOSER_BUBBLE_CANCEL_BUTTON_TEXT); | 197 l10n_util::GetNSString(IDS_DEVICE_CHOOSER_CANCEL_BUTTON_TEXT); |
| 198 return [self createButtonWithTitle:cancelTitle]; | 198 return [self createButtonWithTitle:cancelTitle]; |
| 199 } | 199 } |
| 200 | 200 |
| 201 - (base::scoped_nsobject<NSBox>)createSeparator { | 201 - (base::scoped_nsobject<NSBox>)createSeparator { |
| 202 base::scoped_nsobject<NSBox> spacer([[NSBox alloc] initWithFrame:NSZeroRect]); | 202 base::scoped_nsobject<NSBox> spacer([[NSBox alloc] initWithFrame:NSZeroRect]); |
| 203 [spacer setBoxType:NSBoxSeparator]; | 203 [spacer setBoxType:NSBoxSeparator]; |
| 204 [spacer setBorderType:NSLineBorder]; | 204 [spacer setBorderType:NSLineBorder]; |
| 205 [spacer setAlphaValue:kSeparatorAlphaValue]; | 205 [spacer setAlphaValue:kSeparatorAlphaValue]; |
| 206 [spacer setFrameSize:NSMakeSize(kChooserWidth, kSeparatorHeight)]; | 206 [spacer setFrameSize:NSMakeSize(kChooserWidth, kSeparatorHeight)]; |
| 207 return spacer; | 207 return spacer; |
| 208 } | 208 } |
| 209 | 209 |
| 210 - (base::scoped_nsobject<NSTextField>)createMessage { | 210 - (base::scoped_nsobject<NSTextField>)createMessage { |
| 211 base::scoped_nsobject<NSTextField> messageView( | 211 base::scoped_nsobject<NSTextField> messageView( |
| 212 [[NSTextField alloc] initWithFrame:NSZeroRect]); | 212 [[NSTextField alloc] initWithFrame:NSZeroRect]); |
| 213 [messageView setDrawsBackground:NO]; | 213 [messageView setDrawsBackground:NO]; |
| 214 [messageView setBezeled:NO]; | 214 [messageView setBezeled:NO]; |
| 215 [messageView setEditable:NO]; | 215 [messageView setEditable:NO]; |
| 216 [messageView setSelectable:NO]; | 216 [messageView setSelectable:NO]; |
| 217 [messageView | 217 [messageView |
| 218 setStringValue:l10n_util::GetNSStringF(IDS_CHOOSER_BUBBLE_FOOTNOTE_TEXT, | 218 setStringValue:l10n_util::GetNSStringF(IDS_DEVICE_CHOOSER_FOOTNOTE_TEXT, |
| 219 base::string16())]; | 219 base::string16())]; |
| 220 [messageView setFont:[NSFont systemFontOfSize:[NSFont systemFontSize]]]; | 220 [messageView setFont:[NSFont systemFontOfSize:[NSFont systemFontSize]]]; |
| 221 [messageView sizeToFit]; | 221 [messageView sizeToFit]; |
| 222 return messageView; | 222 return messageView; |
| 223 } | 223 } |
| 224 | 224 |
| 225 - (base::scoped_nsobject<NSButton>)createHelpButton { | 225 - (base::scoped_nsobject<NSButton>)createHelpButton { |
| 226 base::scoped_nsobject<NSButton> button( | 226 base::scoped_nsobject<NSButton> button( |
| 227 [[NSButton alloc] initWithFrame:NSZeroRect]); | 227 [[NSButton alloc] initWithFrame:NSZeroRect]); |
| 228 base::scoped_nsobject<HyperlinkButtonCell> cell([[HyperlinkButtonCell alloc] | 228 base::scoped_nsobject<HyperlinkButtonCell> cell([[HyperlinkButtonCell alloc] |
| 229 initTextCell:l10n_util::GetNSString( | 229 initTextCell:l10n_util::GetNSString( |
| 230 IDS_CHOOSER_BUBBLE_GET_HELP_LINK_TEXT)]); | 230 IDS_DEVICE_CHOOSER_GET_HELP_LINK_TEXT)]); |
| 231 [button setCell:cell.get()]; | 231 [button setCell:cell.get()]; |
| 232 [button sizeToFit]; | 232 [button sizeToFit]; |
| 233 return button; | 233 return button; |
| 234 } | 234 } |
| 235 | 235 |
| 236 - (NSTableView*)tableView { | 236 - (NSTableView*)tableView { |
| 237 return tableView_.get(); | 237 return tableView_.get(); |
| 238 } | 238 } |
| 239 | 239 |
| 240 - (NSButton*)connectButton { | 240 - (NSButton*)connectButton { |
| 241 return connectButton_.get(); | 241 return connectButton_.get(); |
| 242 } | 242 } |
| 243 | 243 |
| 244 - (NSButton*)cancelButton { | 244 - (NSButton*)cancelButton { |
| 245 return cancelButton_.get(); | 245 return cancelButton_.get(); |
| 246 } | 246 } |
| 247 | 247 |
| 248 - (NSButton*)helpButton { | 248 - (NSButton*)helpButton { |
| 249 return helpButton_.get(); | 249 return helpButton_.get(); |
| 250 } | 250 } |
| 251 | 251 |
| 252 @end | 252 @end |
| OLD | NEW |