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 "apps/app_shim/extension_app_shim_handler_mac.h" | 7 #include "apps/app_shim/extension_app_shim_handler_mac.h" |
8 #include "apps/app_window_registry.h" | 8 #include "apps/app_window_registry.h" |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 base::scoped_nsobject<NSMenuItem> item( | 1448 base::scoped_nsobject<NSMenuItem> item( |
1449 [[NSMenuItem alloc] initWithTitle:titleStr | 1449 [[NSMenuItem alloc] initWithTitle:titleStr |
1450 action:@selector(commandFromDock:) | 1450 action:@selector(commandFromDock:) |
1451 keyEquivalent:@""]); | 1451 keyEquivalent:@""]); |
1452 [item setTarget:self]; | 1452 [item setTarget:self]; |
1453 [item setTag:IDC_NEW_WINDOW]; | 1453 [item setTag:IDC_NEW_WINDOW]; |
1454 [item setEnabled:[self validateUserInterfaceItem:item]]; | 1454 [item setEnabled:[self validateUserInterfaceItem:item]]; |
1455 [dockMenu addItem:item]; | 1455 [dockMenu addItem:item]; |
1456 | 1456 |
1457 // |profile| can be NULL during unit tests. | 1457 // |profile| can be NULL during unit tests. |
1458 if (!profile || !profile->IsManaged()) { | 1458 if (!profile || !profile->IsSupervised()) { |
1459 titleStr = l10n_util::GetNSStringWithFixup(IDS_NEW_INCOGNITO_WINDOW_MAC); | 1459 titleStr = l10n_util::GetNSStringWithFixup(IDS_NEW_INCOGNITO_WINDOW_MAC); |
1460 item.reset( | 1460 item.reset( |
1461 [[NSMenuItem alloc] initWithTitle:titleStr | 1461 [[NSMenuItem alloc] initWithTitle:titleStr |
1462 action:@selector(commandFromDock:) | 1462 action:@selector(commandFromDock:) |
1463 keyEquivalent:@""]); | 1463 keyEquivalent:@""]); |
1464 [item setTarget:self]; | 1464 [item setTarget:self]; |
1465 [item setTag:IDC_NEW_INCOGNITO_WINDOW]; | 1465 [item setTag:IDC_NEW_INCOGNITO_WINDOW]; |
1466 [item setEnabled:[self validateUserInterfaceItem:item]]; | 1466 [item setEnabled:[self validateUserInterfaceItem:item]]; |
1467 [dockMenu addItem:item]; | 1467 [dockMenu addItem:item]; |
1468 } | 1468 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1537 | 1537 |
1538 //--------------------------------------------------------------------------- | 1538 //--------------------------------------------------------------------------- |
1539 | 1539 |
1540 namespace app_controller_mac { | 1540 namespace app_controller_mac { |
1541 | 1541 |
1542 bool IsOpeningNewWindow() { | 1542 bool IsOpeningNewWindow() { |
1543 return g_is_opening_new_window; | 1543 return g_is_opening_new_window; |
1544 } | 1544 } |
1545 | 1545 |
1546 } // namespace app_controller_mac | 1546 } // namespace app_controller_mac |
OLD | NEW |