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 "chrome/browser/sessions/session_service.h" | 5 #include "chrome/browser/sessions/session_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 new SessionCommand(kCommandTabNavigationPathPrunedFromFront, | 430 new SessionCommand(kCommandTabNavigationPathPrunedFromFront, |
431 sizeof(payload)); | 431 sizeof(payload)); |
432 memcpy(command->contents(), &payload, sizeof(payload)); | 432 memcpy(command->contents(), &payload, sizeof(payload)); |
433 ScheduleCommand(command); | 433 ScheduleCommand(command); |
434 } | 434 } |
435 | 435 |
436 void SessionService::UpdateTabNavigation( | 436 void SessionService::UpdateTabNavigation( |
437 const SessionID& window_id, | 437 const SessionID& window_id, |
438 const SessionID& tab_id, | 438 const SessionID& tab_id, |
439 const TabNavigation& navigation) { | 439 const TabNavigation& navigation) { |
| 440 LOG(ERROR) << "UpdateTabNavigation, title: " << navigation.title(); |
440 if (!ShouldTrackEntry(navigation.virtual_url()) || | 441 if (!ShouldTrackEntry(navigation.virtual_url()) || |
441 !ShouldTrackChangesToWindow(window_id)) { | 442 !ShouldTrackChangesToWindow(window_id)) { |
442 return; | 443 return; |
443 } | 444 } |
444 | 445 |
445 if (tab_to_available_range_.find(tab_id.id()) != | 446 if (tab_to_available_range_.find(tab_id.id()) != |
446 tab_to_available_range_.end()) { | 447 tab_to_available_range_.end()) { |
447 std::pair<int, int>& range = tab_to_available_range_[tab_id.id()]; | 448 std::pair<int, int>& range = tab_to_available_range_[tab_id.id()]; |
448 range.first = std::min(navigation.index(), range.first); | 449 range.first = std::min(navigation.index(), range.first); |
449 range.second = std::max(navigation.index(), range.second); | 450 range.second = std::max(navigation.index(), range.second); |
(...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1776 contents->GetController().GetDefaultSessionStorageNamespace(); | 1777 contents->GetController().GetDefaultSessionStorageNamespace(); |
1777 session_storage_namespace->SetShouldPersist(false); | 1778 session_storage_namespace->SetShouldPersist(false); |
1778 SessionTabHelper* session_tab_helper = | 1779 SessionTabHelper* session_tab_helper = |
1779 SessionTabHelper::FromWebContents(contents); | 1780 SessionTabHelper::FromWebContents(contents); |
1780 TabClosed(session_tab_helper->window_id(), | 1781 TabClosed(session_tab_helper->window_id(), |
1781 session_tab_helper->session_id(), | 1782 session_tab_helper->session_id(), |
1782 contents->GetClosedByUserGesture()); | 1783 contents->GetClosedByUserGesture()); |
1783 RecordSessionUpdateHistogramData(content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 1784 RecordSessionUpdateHistogramData(content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
1784 &last_updated_tab_closed_time_); | 1785 &last_updated_tab_closed_time_); |
1785 } | 1786 } |
OLD | NEW |