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

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

Issue 411573002: Ensure guest mode browser can activate the correct window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // global flag here, analogue to StartupBrowserCreator::InProcessStartup() 116 // global flag here, analogue to StartupBrowserCreator::InProcessStartup()
117 // because otherwise the SessionService will try to restore sessions when we 117 // because otherwise the SessionService will try to restore sessions when we
118 // make a new window while there are no other active windows. 118 // make a new window while there are no other active windows.
119 bool g_is_opening_new_window = false; 119 bool g_is_opening_new_window = false;
120 120
121 // Activates a browser window having the given profile (the last one active) if 121 // Activates a browser window having the given profile (the last one active) if
122 // possible and returns a pointer to the activate |Browser| or NULL if this was 122 // possible and returns a pointer to the activate |Browser| or NULL if this was
123 // not possible. If the last active browser is minimized (in particular, if 123 // not possible. If the last active browser is minimized (in particular, if
124 // there are only minimized windows), it will unminimize it. 124 // there are only minimized windows), it will unminimize it.
125 Browser* ActivateBrowser(Profile* profile) { 125 Browser* ActivateBrowser(Profile* profile) {
126 Browser* browser = chrome::FindLastActiveWithProfile(profile, 126 Browser* browser = chrome::FindLastActiveWithProfile(
127 profile->IsGuestSession() ? profile->GetOffTheRecordProfile() : profile,
bcwhite 2014/07/23 14:51:37 Note that an OTRProfile is not independent but ass
127 chrome::HOST_DESKTOP_TYPE_NATIVE); 128 chrome::HOST_DESKTOP_TYPE_NATIVE);
128 if (browser) 129 if (browser)
129 browser->window()->Activate(); 130 browser->window()->Activate();
130 return browser; 131 return browser;
131 } 132 }
132 133
133 // Creates an empty browser window with the given profile and returns a pointer 134 // Creates an empty browser window with the given profile and returns a pointer
134 // to the new |Browser|. 135 // to the new |Browser|.
135 Browser* CreateBrowser(Profile* profile) { 136 Browser* CreateBrowser(Profile* profile) {
136 { 137 {
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after
1545 1546
1546 //--------------------------------------------------------------------------- 1547 //---------------------------------------------------------------------------
1547 1548
1548 namespace app_controller_mac { 1549 namespace app_controller_mac {
1549 1550
1550 bool IsOpeningNewWindow() { 1551 bool IsOpeningNewWindow() {
1551 return g_is_opening_new_window; 1552 return g_is_opening_new_window;
1552 } 1553 }
1553 1554
1554 } // namespace app_controller_mac 1555 } // namespace app_controller_mac
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698