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

Side by Side Diff: ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.mm

Issue 2615003002: Use ChromeBrowserStateManager instead of BrowserListIOS. (Closed)
Patch Set: Fix ios_chrome_perftests. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.h" 5 #include "ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/strings/sys_string_conversions.h" 11 #include "base/strings/sys_string_conversions.h"
12 #include "components/sessions/core/session_types.h" 12 #include "components/sessions/core/session_types.h"
13 #include "components/sessions/ios/ios_serialized_navigation_builder.h" 13 #include "components/sessions/ios/ios_serialized_navigation_builder.h"
14 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 14 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
15 #import "ios/chrome/browser/tabs/tab.h" 15 #import "ios/chrome/browser/tabs/tab.h"
16 #import "ios/chrome/browser/tabs/tab_model.h" 16 #import "ios/chrome/browser/tabs/tab_model.h"
17 #include "ios/chrome/browser/ui/browser_ios.h" 17 #import "ios/chrome/browser/tabs/tab_model_list.h"
18 #include "ios/chrome/browser/ui/browser_list_ios.h"
19 #import "ios/web/navigation/navigation_manager_impl.h" 18 #import "ios/web/navigation/navigation_manager_impl.h"
20 #include "ios/web/public/navigation_item.h" 19 #include "ios/web/public/navigation_item.h"
21 #import "ios/web/web_state/web_state_impl.h" 20 #import "ios/web/web_state/web_state_impl.h"
22 #import "net/base/mac/url_conversions.h" 21 #import "net/base/mac/url_conversions.h"
23 22
24 using web::WebStateImpl; 23 using web::WebStateImpl;
25 24
26 TabRestoreServiceDelegateImplIOS::TabRestoreServiceDelegateImplIOS( 25 TabRestoreServiceDelegateImplIOS::TabRestoreServiceDelegateImplIOS(
27 ios::ChromeBrowserState* browser_state) 26 ios::ChromeBrowserState* browser_state)
28 : browser_state_(browser_state) {} 27 : browser_state_(browser_state) {}
29 28
30 TabRestoreServiceDelegateImplIOS::~TabRestoreServiceDelegateImplIOS() {} 29 TabRestoreServiceDelegateImplIOS::~TabRestoreServiceDelegateImplIOS() {}
31 30
32 TabModel* TabRestoreServiceDelegateImplIOS::tab_model() const { 31 TabModel* TabRestoreServiceDelegateImplIOS::tab_model() const {
33 id<BrowserIOS> browser = 32 return GetLastActiveTabModelForChromeBrowserState(browser_state_);
34 BrowserListIOS::GetLastActiveWithBrowserState(browser_state_);
35 return [browser tabModel];
36 } 33 }
37 34
38 void TabRestoreServiceDelegateImplIOS::ShowBrowserWindow() { 35 void TabRestoreServiceDelegateImplIOS::ShowBrowserWindow() {
39 // No need to do anything here, as the singleton browser "window" is already 36 // No need to do anything here, as the singleton browser "window" is already
40 // shown. 37 // shown.
41 } 38 }
42 39
43 const SessionID& TabRestoreServiceDelegateImplIOS::GetSessionID() const { 40 const SessionID& TabRestoreServiceDelegateImplIOS::GetSessionID() const {
44 return session_id_; 41 return session_id_;
45 } 42 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // to reload. 107 // to reload.
111 Tab* tab = tab_model().currentTab; 108 Tab* tab = tab_model().currentTab;
112 [tab replaceHistoryWithNavigations:navigations 109 [tab replaceHistoryWithNavigations:navigations
113 currentIndex:selected_navigation]; 110 currentIndex:selected_navigation];
114 return nullptr; 111 return nullptr;
115 } 112 }
116 113
117 void TabRestoreServiceDelegateImplIOS::CloseTab() { 114 void TabRestoreServiceDelegateImplIOS::CloseTab() {
118 [[tab_model() currentTab] close]; 115 [[tab_model() currentTab] close];
119 } 116 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698