Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Side by Side Diff: chrome/browser/ui/cocoa/bubble_combobox.mm

Issue 1133713009: Subject .mm files to the header sorting presubmit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase - of course... it would be one of my patches I conflict with :| Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/bubble_combobox.h" 5 #import "chrome/browser/ui/cocoa/bubble_combobox.h"
6 6
7 #include "base/strings/sys_string_conversions.h"
7 #include "ui/base/models/combobox_model.h" 8 #include "ui/base/models/combobox_model.h"
8 #include "base/strings/sys_string_conversions.h"
9 9
10 @implementation BubbleCombobox 10 @implementation BubbleCombobox
11 11
12 - (id)initWithFrame:(NSRect)frame 12 - (id)initWithFrame:(NSRect)frame
13 pullsDown:(BOOL)pullsDown 13 pullsDown:(BOOL)pullsDown
14 model:(ui::ComboboxModel*)model { 14 model:(ui::ComboboxModel*)model {
15 if ((self = [super initWithFrame:frame pullsDown:pullsDown])) { 15 if ((self = [super initWithFrame:frame pullsDown:pullsDown])) {
16 [self setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; 16 [self setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
17 [self setBordered:YES]; 17 [self setBordered:YES];
18 [[self cell] setControlSize:NSSmallControlSize]; 18 [[self cell] setControlSize:NSSmallControlSize];
19 19
20 for (int i = 0; i < model->GetItemCount(); ++i) { 20 for (int i = 0; i < model->GetItemCount(); ++i) {
21 if (model->IsItemSeparatorAt(i)) 21 if (model->IsItemSeparatorAt(i))
22 [[self menu] addItem:[NSMenuItem separatorItem]]; 22 [[self menu] addItem:[NSMenuItem separatorItem]];
23 else 23 else
24 [self addItemWithTitle:base::SysUTF16ToNSString(model->GetItemAt(i))]; 24 [self addItemWithTitle:base::SysUTF16ToNSString(model->GetItemAt(i))];
25 } 25 }
26 26
27 [self selectItemAtIndex:model->GetDefaultIndex()]; 27 [self selectItemAtIndex:model->GetDefaultIndex()];
28 } 28 }
29 return self; 29 return self;
30 } 30 }
31 31
32 @end 32 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_factory_cocoa.mm ('k') | chrome/browser/ui/cocoa/chrome_event_processing_window.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698