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_types.h" | 5 #include "chrome/browser/sessions/session_types.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/pickle.h" | 8 #include "base/pickle.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 sync_data.set_navigation_from_address_bar( | 407 sync_data.set_navigation_from_address_bar( |
408 (transition_type_ & content::PAGE_TRANSITION_FROM_ADDRESS_BAR) != 0); | 408 (transition_type_ & content::PAGE_TRANSITION_FROM_ADDRESS_BAR) != 0); |
409 sync_data.set_navigation_home_page( | 409 sync_data.set_navigation_home_page( |
410 (transition_type_ & content::PAGE_TRANSITION_HOME_PAGE) != 0); | 410 (transition_type_ & content::PAGE_TRANSITION_HOME_PAGE) != 0); |
411 sync_data.set_navigation_chain_start( | 411 sync_data.set_navigation_chain_start( |
412 (transition_type_ & content::PAGE_TRANSITION_CHAIN_START) != 0); | 412 (transition_type_ & content::PAGE_TRANSITION_CHAIN_START) != 0); |
413 sync_data.set_navigation_chain_end( | 413 sync_data.set_navigation_chain_end( |
414 (transition_type_ & content::PAGE_TRANSITION_CHAIN_END) != 0); | 414 (transition_type_ & content::PAGE_TRANSITION_CHAIN_END) != 0); |
415 | 415 |
416 sync_data.set_unique_id(unique_id_); | 416 sync_data.set_unique_id(unique_id_); |
417 // TODO(akalin): Don't lose resolution, i.e. define a new timestamp | |
418 // field with microsecond resolution and use that. | |
419 sync_data.set_timestamp(syncer::TimeToProtoTime(timestamp_)); | 417 sync_data.set_timestamp(syncer::TimeToProtoTime(timestamp_)); |
| 418 // The full-resolution timestamp works as a global ID. |
| 419 sync_data.set_global_id(timestamp_.ToInternalValue()); |
420 | 420 |
421 return sync_data; | 421 return sync_data; |
422 } | 422 } |
423 | 423 |
424 // static | 424 // static |
425 std::vector<NavigationEntry*> | 425 std::vector<NavigationEntry*> |
426 TabNavigation::CreateNavigationEntriesFromTabNavigations( | 426 TabNavigation::CreateNavigationEntriesFromTabNavigations( |
427 const std::vector<TabNavigation>& navigations, | 427 const std::vector<TabNavigation>& navigations, |
428 content::BrowserContext* browser_context) { | 428 content::BrowserContext* browser_context) { |
429 int page_id = 0; | 429 int page_id = 0; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 SessionWindow::SessionWindow() | 486 SessionWindow::SessionWindow() |
487 : selected_tab_index(-1), | 487 : selected_tab_index(-1), |
488 type(Browser::TYPE_TABBED), | 488 type(Browser::TYPE_TABBED), |
489 is_constrained(true), | 489 is_constrained(true), |
490 show_state(ui::SHOW_STATE_DEFAULT) { | 490 show_state(ui::SHOW_STATE_DEFAULT) { |
491 } | 491 } |
492 | 492 |
493 SessionWindow::~SessionWindow() { | 493 SessionWindow::~SessionWindow() { |
494 STLDeleteElements(&tabs); | 494 STLDeleteElements(&tabs); |
495 } | 495 } |
OLD | NEW |