| 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/app_controller_mac.h" | 5 #import "chrome/browser/app_controller_mac.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1321 if (applications.size()) { | 1321 if (applications.size()) { |
| 1322 int position = 0; | 1322 int position = 0; |
| 1323 NSString* menuStr = | 1323 NSString* menuStr = |
| 1324 l10n_util::GetNSStringWithFixup(IDS_BACKGROUND_APPS_MAC); | 1324 l10n_util::GetNSStringWithFixup(IDS_BACKGROUND_APPS_MAC); |
| 1325 base::scoped_nsobject<NSMenu> appMenu( | 1325 base::scoped_nsobject<NSMenu> appMenu( |
| 1326 [[NSMenu alloc] initWithTitle:menuStr]); | 1326 [[NSMenu alloc] initWithTitle:menuStr]); |
| 1327 for (extensions::ExtensionList::const_iterator cursor = | 1327 for (extensions::ExtensionList::const_iterator cursor = |
| 1328 applications.begin(); | 1328 applications.begin(); |
| 1329 cursor != applications.end(); | 1329 cursor != applications.end(); |
| 1330 ++cursor, ++position) { | 1330 ++cursor, ++position) { |
| 1331 DCHECK_EQ(applications.GetPosition(*cursor), position); | 1331 DCHECK_EQ(applications.GetPosition(cursor->get()), position); |
| 1332 NSString* itemStr = | 1332 NSString* itemStr = |
| 1333 base::SysUTF16ToNSString(UTF8ToUTF16((*cursor)->name())); | 1333 base::SysUTF16ToNSString(UTF8ToUTF16((*cursor)->name())); |
| 1334 base::scoped_nsobject<NSMenuItem> appItem( | 1334 base::scoped_nsobject<NSMenuItem> appItem( |
| 1335 [[NSMenuItem alloc] initWithTitle:itemStr | 1335 [[NSMenuItem alloc] initWithTitle:itemStr |
| 1336 action:@selector(executeApplication:) | 1336 action:@selector(executeApplication:) |
| 1337 keyEquivalent:@""]); | 1337 keyEquivalent:@""]); |
| 1338 [appItem setTarget:self]; | 1338 [appItem setTarget:self]; |
| 1339 [appItem setTag:position]; | 1339 [appItem setTag:position]; |
| 1340 [appMenu addItem:appItem]; | 1340 [appMenu addItem:appItem]; |
| 1341 } | 1341 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1381 | 1381 |
| 1382 //--------------------------------------------------------------------------- | 1382 //--------------------------------------------------------------------------- |
| 1383 | 1383 |
| 1384 namespace app_controller_mac { | 1384 namespace app_controller_mac { |
| 1385 | 1385 |
| 1386 bool IsOpeningNewWindow() { | 1386 bool IsOpeningNewWindow() { |
| 1387 return g_is_opening_new_window; | 1387 return g_is_opening_new_window; |
| 1388 } | 1388 } |
| 1389 | 1389 |
| 1390 } // namespace app_controller_mac | 1390 } // namespace app_controller_mac |
| OLD | NEW |