| 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/file_path.h" | 10 #include "base/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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 // http://code.google.com/p/chromium/issues/detail?id=43048 . | 777 // http://code.google.com/p/chromium/issues/detail?id=43048 . |
| 776 // | 778 // |
| 777 // TODO(akalin,viettrungluu): Figure out whether this method | 779 // TODO(akalin,viettrungluu): Figure out whether this method |
| 778 // can be prevented from being called if lastProfile is | 780 // can be prevented from being called if lastProfile is |
| 779 // NULL. | 781 // NULL. |
| 780 if (!lastProfile) { | 782 if (!lastProfile) { |
| 781 LOG(WARNING) | 783 LOG(WARNING) |
| 782 << "NULL lastProfile detected -- not doing anything"; | 784 << "NULL lastProfile detected -- not doing anything"; |
| 783 break; | 785 break; |
| 784 } | 786 } |
| 785 enable = ![self keyWindowIsModal]; | 787 SigninManager* signin = SigninManagerFactory::GetForProfile( |
| 788 lastProfile->GetOriginalProfile()); |
| 789 enable = signin->IsSigninAllowed() && |
| 790 ![self keyWindowIsModal]; |
| 786 [BrowserWindowController updateSigninItem:item | 791 [BrowserWindowController updateSigninItem:item |
| 787 shouldShow:enable | 792 shouldShow:enable |
| 788 currentProfile:lastProfile]; | 793 currentProfile:lastProfile]; |
| 789 break; | 794 break; |
| 790 } | 795 } |
| 791 case IDC_FEEDBACK: | 796 case IDC_FEEDBACK: |
| 792 enable = NO; | 797 enable = NO; |
| 793 break; | 798 break; |
| 794 default: | 799 default: |
| 795 enable = menuState_->IsCommandEnabled(tag) ? | 800 enable = menuState_->IsCommandEnabled(tag) ? |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1348 | 1353 |
| 1349 //--------------------------------------------------------------------------- | 1354 //--------------------------------------------------------------------------- |
| 1350 | 1355 |
| 1351 namespace app_controller_mac { | 1356 namespace app_controller_mac { |
| 1352 | 1357 |
| 1353 bool IsOpeningNewWindow() { | 1358 bool IsOpeningNewWindow() { |
| 1354 return g_is_opening_new_window; | 1359 return g_is_opening_new_window; |
| 1355 } | 1360 } |
| 1356 | 1361 |
| 1357 } // namespace app_controller_mac | 1362 } // namespace app_controller_mac |
| OLD | NEW |