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

Unified Diff: ios/chrome/browser/tabs/tab_model_list.mm

Issue 2628273004: Revert of Use ChromeBrowserStateManager instead of BrowserListIOS. (Closed)
Patch Set: Created 3 years, 11 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
Index: ios/chrome/browser/tabs/tab_model_list.mm
diff --git a/ios/chrome/browser/tabs/tab_model_list.mm b/ios/chrome/browser/tabs/tab_model_list.mm
index eba1a08aa3b647abb4f18687a63e17ef8823d0d3..b95622321673fe6d636a45fac038d046872e07fc 100644
--- a/ios/chrome/browser/tabs/tab_model_list.mm
+++ b/ios/chrome/browser/tabs/tab_model_list.mm
@@ -7,9 +7,7 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/supports_user_data.h"
-#include "ios/chrome/browser/application_context.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
-#include "ios/chrome/browser/browser_state/chrome_browser_state_manager.h"
#import "ios/chrome/browser/tabs/tab_model.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
@@ -87,45 +85,3 @@
TabModelList::GetForBrowserState(browser_state, false);
return tab_model_list ? [tab_model_list->tab_models() allObjects] : nil;
}
-
-TabModel* GetLastActiveTabModelForChromeBrowserState(
- ios::ChromeBrowserState* browser_state) {
- TabModelList* tab_model_list =
- TabModelList::GetForBrowserState(browser_state, false);
- if (!tab_model_list || [tab_model_list->tab_models() count] == 0u)
- return nil;
-
- // There is currently no way to mark a TabModel as active. Assert that there
- // is only one TabModel associated with |browser_state| until it is possible
- // to mark a TabModel as active.
- DCHECK_EQ([tab_model_list->tab_models() count], 1u);
- return [tab_model_list->tab_models() anyObject];
-}
-
-bool IsOffTheRecordSessionActive() {
- std::vector<ios::ChromeBrowserState*> browser_states =
- GetApplicationContext()
- ->GetChromeBrowserStateManager()
- ->GetLoadedBrowserStates();
-
- for (ios::ChromeBrowserState* browser_state : browser_states) {
- DCHECK(!browser_state->IsOffTheRecord());
- if (!browser_state->HasOffTheRecordChromeBrowserState())
- continue;
-
- ios::ChromeBrowserState* otr_browser_state =
- browser_state->GetOffTheRecordChromeBrowserState();
-
- TabModelList* tab_model_list =
- TabModelList::GetForBrowserState(otr_browser_state, false);
- if (!tab_model_list)
- continue;
-
- for (TabModel* tab_model in tab_model_list->tab_models()) {
- if (![tab_model isEmpty])
- return true;
- }
- }
-
- return false;
-}
« no previous file with comments | « ios/chrome/browser/tabs/tab_model_list.h ('k') | ios/chrome/browser/tabs/tab_model_synced_window_delegate.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698