OLD | NEW |
---|---|
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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 | 207 |
208 void CheckReloadedPageRestored() { | 208 void CheckReloadedPageRestored() { |
209 CheckTitle(browser(), title_pass_); | 209 CheckTitle(browser(), title_pass_); |
210 } | 210 } |
211 | 211 |
212 void CheckReloadedPageRestored(Browser* browser) { | 212 void CheckReloadedPageRestored(Browser* browser) { |
213 CheckTitle(browser, title_pass_); | 213 CheckTitle(browser, title_pass_); |
214 } | 214 } |
215 | 215 |
216 void CheckReloadedPageNotRestored() { | 216 void CheckReloadedPageNotRestored() { |
217 // If only active tabs are loaded, force loading of the tab. | |
218 if (SessionRestore::IsLoadingActiveTabsOnly()) { | |
219 content::WebContents* web_contents = | |
220 browser()->tab_strip_model()->GetWebContentsAt(0); | |
sky
2015/04/16 15:40:10
Is there only ever one webcontents that isn't load
Georges Khalil
2015/04/16 18:10:18
Yes, this only has one page. If calls CheckTitle w
| |
221 web_contents->GetController().LoadIfNecessary(); | |
222 } | |
217 CheckReloadedPageNotRestored(browser()); | 223 CheckReloadedPageNotRestored(browser()); |
218 } | 224 } |
219 | 225 |
220 void CheckReloadedPageNotRestored(Browser* browser) { | 226 void CheckReloadedPageNotRestored(Browser* browser) { |
221 CheckTitle(browser, title_storing_); | 227 CheckTitle(browser, title_storing_); |
222 } | 228 } |
223 | 229 |
224 void CheckTitle(Browser* browser, const base::string16& expected_title) { | 230 void CheckTitle(Browser* browser, const base::string16& expected_title) { |
225 content::WebContents* web_contents = | 231 content::WebContents* web_contents = |
226 browser->tab_strip_model()->GetWebContentsAt(0); | 232 browser->tab_strip_model()->GetWebContentsAt(0); |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
835 CookieSettings::Factory::GetForProfile(new_browser->profile())-> | 841 CookieSettings::Factory::GetForProfile(new_browser->profile())-> |
836 SetDefaultCookieSetting(CONTENT_SETTING_SESSION_ONLY); | 842 SetDefaultCookieSetting(CONTENT_SETTING_SESSION_ONLY); |
837 // ... even if background mode is active. | 843 // ... even if background mode is active. |
838 EnableBackgroundMode(); | 844 EnableBackgroundMode(); |
839 new_browser = QuitBrowserAndRestore(new_browser, true); | 845 new_browser = QuitBrowserAndRestore(new_browser, true); |
840 StoreDataWithPage(new_browser, "cookies.html"); | 846 StoreDataWithPage(new_browser, "cookies.html"); |
841 DisableBackgroundMode(); | 847 DisableBackgroundMode(); |
842 new_browser = QuitBrowserAndRestore(new_browser, true); | 848 new_browser = QuitBrowserAndRestore(new_browser, true); |
843 StoreDataWithPage(new_browser, "cookies.html"); | 849 StoreDataWithPage(new_browser, "cookies.html"); |
844 } | 850 } |
OLD | NEW |