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

Unified Diff: chrome/browser/sessions/session_types.cc

Issue 10832080: Upstream session_backend_android. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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
« no previous file with comments | « chrome/browser/sessions/session_types.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_types.cc
diff --git a/chrome/browser/sessions/session_types.cc b/chrome/browser/sessions/session_types.cc
index 5691f8d635ce2e50f17356e1ec7168dc5124c04a..908380821d52f5ce8a589618f0b65ca700a4ff84 100644
--- a/chrome/browser/sessions/session_types.cc
+++ b/chrome/browser/sessions/session_types.cc
@@ -129,6 +129,17 @@ SessionTab::SessionTab()
SessionTab::~SessionTab() {
}
+int SessionTab::NormalizedNavigationIndex() const {
+ int selected_index = this->current_navigation_index;
+ // Bounds checking. Lowest value allowed is 0, so we need to check for max if
+ // navigations.size() == 0 or if selected_index is negative.
+ selected_index = std::max(
sky 2012/08/03 17:21:39 Combine all this into a single return, eg: return
felipeg 2012/08/06 16:54:53 Done.
+ 0,
+ std::min(selected_index,
+ static_cast<int>(this->navigations.size() - 1)));
+ return selected_index;
+}
+
// SessionWindow ---------------------------------------------------------------
SessionWindow::SessionWindow()
« no previous file with comments | « chrome/browser/sessions/session_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698