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 17 matching lines...) Expand all Loading... |
28 #include "chrome/browser/first_run/first_run.h" | 28 #include "chrome/browser/first_run/first_run.h" |
29 #include "chrome/browser/lifetime/application_lifetime.h" | 29 #include "chrome/browser/lifetime/application_lifetime.h" |
30 #include "chrome/browser/printing/print_dialog_cloud.h" | 30 #include "chrome/browser/printing/print_dialog_cloud.h" |
31 #include "chrome/browser/profiles/profile_manager.h" | 31 #include "chrome/browser/profiles/profile_manager.h" |
32 #include "chrome/browser/service/service_process_control.h" | 32 #include "chrome/browser/service/service_process_control.h" |
33 #include "chrome/browser/sessions/session_restore.h" | 33 #include "chrome/browser/sessions/session_restore.h" |
34 #include "chrome/browser/sessions/session_service.h" | 34 #include "chrome/browser/sessions/session_service.h" |
35 #include "chrome/browser/sessions/session_service_factory.h" | 35 #include "chrome/browser/sessions/session_service_factory.h" |
36 #include "chrome/browser/sessions/tab_restore_service.h" | 36 #include "chrome/browser/sessions/tab_restore_service.h" |
37 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 37 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 38 #include "chrome/browser/signin/signin_manager.h" |
| 39 #include "chrome/browser/signin/signin_manager_factory.h" |
38 #include "chrome/browser/sync/profile_sync_service.h" | 40 #include "chrome/browser/sync/profile_sync_service.h" |
39 #include "chrome/browser/sync/sync_ui_util.h" | 41 #include "chrome/browser/sync/sync_ui_util.h" |
40 #include "chrome/browser/ui/browser.h" | 42 #include "chrome/browser/ui/browser.h" |
41 #include "chrome/browser/ui/browser_command_controller.h" | 43 #include "chrome/browser/ui/browser_command_controller.h" |
42 #include "chrome/browser/ui/browser_commands.h" | 44 #include "chrome/browser/ui/browser_commands.h" |
43 #include "chrome/browser/ui/browser_finder.h" | 45 #include "chrome/browser/ui/browser_finder.h" |
44 #include "chrome/browser/ui/browser_iterator.h" | 46 #include "chrome/browser/ui/browser_iterator.h" |
45 #include "chrome/browser/ui/browser_mac.h" | 47 #include "chrome/browser/ui/browser_mac.h" |
46 #include "chrome/browser/ui/browser_window.h" | 48 #include "chrome/browser/ui/browser_window.h" |
47 #include "chrome/browser/ui/chrome_pages.h" | 49 #include "chrome/browser/ui/chrome_pages.h" |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 // http://code.google.com/p/chromium/issues/detail?id=43048 . | 780 // http://code.google.com/p/chromium/issues/detail?id=43048 . |
779 // | 781 // |
780 // TODO(akalin,viettrungluu): Figure out whether this method | 782 // TODO(akalin,viettrungluu): Figure out whether this method |
781 // can be prevented from being called if lastProfile is | 783 // can be prevented from being called if lastProfile is |
782 // NULL. | 784 // NULL. |
783 if (!lastProfile) { | 785 if (!lastProfile) { |
784 LOG(WARNING) | 786 LOG(WARNING) |
785 << "NULL lastProfile detected -- not doing anything"; | 787 << "NULL lastProfile detected -- not doing anything"; |
786 break; | 788 break; |
787 } | 789 } |
788 enable = ![self keyWindowIsModal]; | 790 SigninManager* signin = SigninManagerFactory::GetForProfile( |
| 791 lastProfile->GetOriginalProfile()); |
| 792 enable = signin->IsSigninAllowed() && |
| 793 ![self keyWindowIsModal]; |
789 [BrowserWindowController updateSigninItem:item | 794 [BrowserWindowController updateSigninItem:item |
790 shouldShow:enable | 795 shouldShow:enable |
791 currentProfile:lastProfile]; | 796 currentProfile:lastProfile]; |
792 break; | 797 break; |
793 } | 798 } |
794 case IDC_FEEDBACK: | 799 case IDC_FEEDBACK: |
795 enable = NO; | 800 enable = NO; |
796 break; | 801 break; |
797 default: | 802 default: |
798 enable = menuState_->IsCommandEnabled(tag) ? | 803 enable = menuState_->IsCommandEnabled(tag) ? |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1352 | 1357 |
1353 //--------------------------------------------------------------------------- | 1358 //--------------------------------------------------------------------------- |
1354 | 1359 |
1355 namespace app_controller_mac { | 1360 namespace app_controller_mac { |
1356 | 1361 |
1357 bool IsOpeningNewWindow() { | 1362 bool IsOpeningNewWindow() { |
1358 return g_is_opening_new_window; | 1363 return g_is_opening_new_window; |
1359 } | 1364 } |
1360 | 1365 |
1361 } // namespace app_controller_mac | 1366 } // namespace app_controller_mac |
OLD | NEW |