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

Side by Side Diff: chrome/browser/ui/android/tab_model/android_live_tab_context.cc

Issue 2225343002: Navigation: move RestoreType and ReloadType into a separate file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: trybots ran with PS8, but one more safe change is added here Created 4 years, 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/android/tab_android.h" 5 #include "chrome/browser/android/tab_android.h"
6 #include "chrome/browser/profiles/profile.h" 6 #include "chrome/browser/profiles/profile.h"
7 #include "chrome/browser/ui/android/tab_model/android_live_tab_context.h" 7 #include "chrome/browser/ui/android/tab_model/android_live_tab_context.h"
8 #include "chrome/browser/ui/android/tab_model/tab_model.h" 8 #include "chrome/browser/ui/android/tab_model/tab_model.h"
9 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" 9 #include "chrome/browser/ui/android/tab_model/tab_model_list.h"
10 #include "components/sessions/content/content_live_tab.h" 10 #include "components/sessions/content/content_live_tab.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 // Prepare navigation history. 73 // Prepare navigation history.
74 std::vector<std::unique_ptr<content::NavigationEntry>> nav_entries = 74 std::vector<std::unique_ptr<content::NavigationEntry>> nav_entries =
75 sessions::ContentSerializedNavigationBuilder::ToNavigationEntries( 75 sessions::ContentSerializedNavigationBuilder::ToNavigationEntries(
76 navigations, profile); 76 navigations, profile);
77 77
78 // Restore web contents with navigation history. 78 // Restore web contents with navigation history.
79 content::WebContents* web_contents = content::WebContents::Create( 79 content::WebContents* web_contents = content::WebContents::Create(
80 content::WebContents::CreateParams(profile)); 80 content::WebContents::CreateParams(profile));
81 web_contents->GetController().Restore( 81 web_contents->GetController().Restore(
82 selected_navigation, 82 selected_navigation, content::RestoreType::CURRENT_SESSION, &nav_entries);
83 content::NavigationController::RESTORE_CURRENT_SESSION,
84 &nav_entries);
85 83
86 // Create new tab. 84 // Create new tab.
87 tab_model_->CreateTab(nullptr, web_contents, -1); 85 tab_model_->CreateTab(nullptr, web_contents, -1);
88 return sessions::ContentLiveTab::GetForWebContents(web_contents); 86 return sessions::ContentLiveTab::GetForWebContents(web_contents);
89 } 87 }
90 88
91 // Currently does nothing. 89 // Currently does nothing.
92 sessions::LiveTab* AndroidLiveTabContext::ReplaceRestoredTab( 90 sessions::LiveTab* AndroidLiveTabContext::ReplaceRestoredTab(
93 const std::vector<sessions::SerializedNavigationEntry>& navigations, 91 const std::vector<sessions::SerializedNavigationEntry>& navigations,
94 int selected_navigation, 92 int selected_navigation,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 for (auto it = TabModelList::begin(); it != TabModelList::end(); ++it) { 127 for (auto it = TabModelList::begin(); it != TabModelList::end(); ++it) {
130 TabModel* model = *it; 128 TabModel* model = *it;
131 if (!model->IsOffTheRecord()) { 129 if (!model->IsOffTheRecord()) {
132 return model->GetLiveTabContext(); 130 return model->GetLiveTabContext();
133 } 131 }
134 } 132 }
135 } 133 }
136 134
137 return tab_model ? tab_model->GetLiveTabContext() : nullptr; 135 return tab_model ? tab_model->GetLiveTabContext() : nullptr;
138 } 136 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698