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

Unified Diff: chrome/browser/managed_mode/managed_mode_navigation_observer.cc

Issue 12207051: Make ManagedMode's GoBackToSafety feature kinda' multi-desktop aware...! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/managed_mode/managed_mode_navigation_observer.cc
diff --git a/chrome/browser/managed_mode/managed_mode_navigation_observer.cc b/chrome/browser/managed_mode/managed_mode_navigation_observer.cc
index e47860e1230443fa84861e8ab4044d4ae816d92b..a01619e4333f8096e772bd32473015e4e457b8ec 100644
--- a/chrome/browser/managed_mode/managed_mode_navigation_observer.cc
+++ b/chrome/browser/managed_mode/managed_mode_navigation_observer.cc
@@ -22,7 +22,8 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_finder.h"
-#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/ui/browser_list_impl.h"
+#include "chrome/browser/ui/host_desktop.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
@@ -88,9 +89,13 @@ void GoBackToSafety(content::WebContents* web_contents) {
}
// If we can't go back (because we opened a new tab), try to close the tab.
- // If this is the last tab, open a new window.
- if (BrowserList::size() == 1) {
- Browser* browser = *(BrowserList::begin());
+ // If this is the last tab on this desktop, open a new window.
+ chrome::HostDesktopType host_desktop_type =
+ chrome::GetHostDesktopTypeForNativeView(web_contents->GetNativeView());
+ const chrome::BrowserListImpl* browser_list =
+ chrome::BrowserListImpl::GetInstance(host_desktop_type);
+ if (browser_list->size() == 1) {
+ Browser* browser = browser_list->get(0);
DCHECK(browser == chrome::FindBrowserWithWebContents(web_contents));
if (browser->tab_strip_model()->count() == 1)
chrome::NewEmptyWindow(browser->profile());
« 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