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

Side by Side Diff: chrome/browser/sessions/session_restore.cc

Issue 2409423005: Compare GURLs to kUrlConstants with .spec() and string equality (Closed)
Patch Set: rebase on dependent patch Created 4 years, 2 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 | « chrome/browser/search/search.cc ('k') | chrome/browser/sync/chrome_sync_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/sessions/session_restore.h" 5 #include "chrome/browser/sessions/session_restore.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 SessionRestore::on_session_restored_callbacks()); 766 SessionRestore::on_session_restored_callbacks());
767 return restorer->Restore(); 767 return restorer->Restore();
768 } 768 }
769 769
770 // static 770 // static
771 void SessionRestore::RestoreSessionAfterCrash(Browser* browser) { 771 void SessionRestore::RestoreSessionAfterCrash(Browser* browser) {
772 uint32_t behavior = 0; 772 uint32_t behavior = 0;
773 if (browser->tab_strip_model()->count() == 1) { 773 if (browser->tab_strip_model()->count() == 1) {
774 const content::WebContents* active_tab = 774 const content::WebContents* active_tab =
775 browser->tab_strip_model()->GetWebContentsAt(0); 775 browser->tab_strip_model()->GetWebContentsAt(0);
776 if (active_tab->GetURL() == GURL(chrome::kChromeUINewTabURL) || 776 if (active_tab->GetURL() == chrome::kChromeUINewTabURL ||
777 search::IsInstantNTP(active_tab)) { 777 search::IsInstantNTP(active_tab)) {
778 // There is only one tab and its the new tab page, make session restore 778 // There is only one tab and its the new tab page, make session restore
779 // clobber it. 779 // clobber it.
780 behavior = SessionRestore::CLOBBER_CURRENT_TAB; 780 behavior = SessionRestore::CLOBBER_CURRENT_TAB;
781 } 781 }
782 } 782 }
783 SessionRestore::RestoreSession(browser->profile(), browser, behavior, 783 SessionRestore::RestoreSession(browser->profile(), browser, behavior,
784 std::vector<GURL>()); 784 std::vector<GURL>());
785 } 785 }
786 786
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 // static 838 // static
839 SessionRestore::CallbackSubscription 839 SessionRestore::CallbackSubscription
840 SessionRestore::RegisterOnSessionRestoredCallback( 840 SessionRestore::RegisterOnSessionRestoredCallback(
841 const base::Callback<void(int)>& callback) { 841 const base::Callback<void(int)>& callback) {
842 return on_session_restored_callbacks()->Add(callback); 842 return on_session_restored_callbacks()->Add(callback);
843 } 843 }
844 844
845 // static 845 // static
846 base::CallbackList<void(int)>* 846 base::CallbackList<void(int)>*
847 SessionRestore::on_session_restored_callbacks_ = nullptr; 847 SessionRestore::on_session_restored_callbacks_ = nullptr;
OLDNEW
« no previous file with comments | « chrome/browser/search/search.cc ('k') | chrome/browser/sync/chrome_sync_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698