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/infobars/media_stream_infobar_controller.h" | 5 #import "chrome/browser/ui/cocoa/infobars/media_stream_infobar_controller.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #import "base/sys_string_conversions.h" | 10 #import "base/sys_string_conversions.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 // Add title item. | 222 // Add title item. |
223 NSString* menuTitle = GetNSStringWithFixup( | 223 NSString* menuTitle = GetNSStringWithFixup( |
224 IDS_MEDIA_CAPTURE_DEVICES_MENU_TITLE); | 224 IDS_MEDIA_CAPTURE_DEVICES_MENU_TITLE); |
225 NSMenuItem* titleItem = | 225 NSMenuItem* titleItem = |
226 [menu addItemWithTitle:menuTitle | 226 [menu addItemWithTitle:menuTitle |
227 action:NULL | 227 action:NULL |
228 keyEquivalent:@""]; | 228 keyEquivalent:@""]; |
229 [titleItem setState:NSOffState]; | 229 [titleItem setState:NSOffState]; |
230 | 230 |
231 [menu addItem:[NSMenuItem separatorItem]]; | |
232 | |
233 // Add all capture devices. | 231 // Add all capture devices. |
234 for (int i = 0; i < deviceMenuModel_->GetItemCount(); ++i) { | 232 for (int i = 0; i < deviceMenuModel_->GetItemCount(); ++i) { |
235 if (deviceMenuModel_->GetCommandIdAt(i) == -1) { | 233 if (deviceMenuModel_->GetCommandIdAt(i) == -1) { |
236 [menu addItem:[NSMenuItem separatorItem]]; | 234 [menu addItem:[NSMenuItem separatorItem]]; |
237 } else { | 235 } else { |
238 NSString* title = | 236 NSString* title = |
239 base::SysUTF16ToNSString(deviceMenuModel_->GetLabelAt(i)); | 237 base::SysUTF16ToNSString(deviceMenuModel_->GetLabelAt(i)); |
240 NSMenuItem* item = [menu addItemWithTitle:title | 238 NSMenuItem* item = [menu addItemWithTitle:title |
241 action:@selector(deviceMenuChanged:) | 239 action:@selector(deviceMenuChanged:) |
242 keyEquivalent:@""]; | 240 keyEquivalent:@""]; |
(...skipping 18 matching lines...) Expand all Loading... |
261 [[[deviceMenu_ menu] itemAtIndex:0] setTitle:@""]; | 259 [[[deviceMenu_ menu] itemAtIndex:0] setTitle:@""]; |
262 [[deviceMenu_ cell] setArrowPosition:NSPopUpArrowAtCenter]; | 260 [[deviceMenu_ cell] setArrowPosition:NSPopUpArrowAtCenter]; |
263 } | 261 } |
264 } | 262 } |
265 | 263 |
266 - (void)didChangeFrame:(NSNotification*)notification { | 264 - (void)didChangeFrame:(NSNotification*)notification { |
267 [self arrangeInfobarLayout]; | 265 [self arrangeInfobarLayout]; |
268 } | 266 } |
269 | 267 |
270 @end // implementation MediaStreamInfoBarController | 268 @end // implementation MediaStreamInfoBarController |
OLD | NEW |