Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: chrome/browser/app_controller_mac.mm

Issue 2818533003: Make nesting/running states a RunLoop rather than a MessageLoop concept. (Closed)
Patch Set: fix compile Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 if ([delegate respondsToSelector:@selector(commandDispatch:)]) { 939 if ([delegate respondsToSelector:@selector(commandDispatch:)]) {
940 [delegate commandDispatch:sender]; 940 [delegate commandDispatch:sender];
941 return; 941 return;
942 } 942 }
943 } 943 }
944 944
945 // Ignore commands during session restore's browser creation. It uses a 945 // Ignore commands during session restore's browser creation. It uses a
946 // nested message loop and commands dispatched during this operation cause 946 // nested message loop and commands dispatched during this operation cause
947 // havoc. 947 // havoc.
948 if (SessionRestore::IsRestoring(lastProfile) && 948 if (SessionRestore::IsRestoring(lastProfile) &&
949 base::MessageLoop::current()->IsNested()) 949 base::RunLoop::IsNestedOnCurrentThread()) {
950 return; 950 return;
951 }
951 952
952 NSInteger tag = [sender tag]; 953 NSInteger tag = [sender tag];
953 954
954 // If there are no browser windows, and we are trying to open a browser 955 // If there are no browser windows, and we are trying to open a browser
955 // for a locked profile or the system profile, we have to show the User 956 // for a locked profile or the system profile, we have to show the User
956 // Manager instead as the locked profile needs authentication and the system 957 // Manager instead as the locked profile needs authentication and the system
957 // profile cannot have a browser. 958 // profile cannot have a browser.
958 if (IsProfileSignedOut(lastProfile) || lastProfile->IsSystemProfile()) { 959 if (IsProfileSignedOut(lastProfile) || lastProfile->IsSystemProfile()) {
959 UserManager::Show(base::FilePath(), 960 UserManager::Show(base::FilePath(),
960 profiles::USER_MANAGER_NO_TUTORIAL, 961 profiles::USER_MANAGER_NO_TUTORIAL,
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 1609
1609 //--------------------------------------------------------------------------- 1610 //---------------------------------------------------------------------------
1610 1611
1611 namespace app_controller_mac { 1612 namespace app_controller_mac {
1612 1613
1613 bool IsOpeningNewWindow() { 1614 bool IsOpeningNewWindow() {
1614 return g_is_opening_new_window; 1615 return g_is_opening_new_window;
1615 } 1616 }
1616 1617
1617 } // namespace app_controller_mac 1618 } // namespace app_controller_mac
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698