| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dom_ui/foreign_session_handler.h" | 5 #include "chrome/browser/dom_ui/foreign_session_handler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include "base/scoped_vector.h" | 10 #include "base/scoped_vector.h" |
| 11 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "chrome/browser/dom_ui/new_tab_ui.h" | 14 #include "chrome/browser/dom_ui/new_tab_ui.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/sessions/session_restore.h" | 16 #include "chrome/browser/sessions/session_restore.h" |
| 17 #include "chrome/browser/sync/engine/syncapi.h" | 17 #include "chrome/browser/sync/engine/syncapi.h" |
| 18 #include "chrome/browser/sync/profile_sync_service.h" | 18 #include "chrome/browser/sync/profile_sync_service.h" |
| 19 #include "chrome/browser/ui/browser.h" | |
| 20 #include "chrome/common/notification_details.h" | 19 #include "chrome/common/notification_details.h" |
| 21 #include "chrome/common/notification_service.h" | 20 #include "chrome/common/notification_service.h" |
| 22 #include "chrome/common/url_constants.h" | 21 #include "chrome/common/url_constants.h" |
| 23 | 22 |
| 24 namespace browser_sync { | 23 namespace browser_sync { |
| 25 | 24 |
| 26 // Maximum number of session we're going to display on the NTP | 25 // Maximum number of session we're going to display on the NTP |
| 27 static const int kMaxSessionsToShow = 10; | 26 static const int kMaxSessionsToShow = 10; |
| 28 | 27 |
| 29 // Invalid value, used to note that we don't have a tab or window number. | 28 // Invalid value, used to note that we don't have a tab or window number. |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 return false; | 233 return false; |
| 235 dictionary->SetString("type", "window"); | 234 dictionary->SetString("type", "window"); |
| 236 dictionary->SetReal("timestamp", | 235 dictionary->SetReal("timestamp", |
| 237 static_cast<double>(window.timestamp.ToInternalValue())); | 236 static_cast<double>(window.timestamp.ToInternalValue())); |
| 238 dictionary->SetInteger("sessionId", window.window_id.id()); | 237 dictionary->SetInteger("sessionId", window.window_id.id()); |
| 239 dictionary->Set("tabs", tab_values.release()); | 238 dictionary->Set("tabs", tab_values.release()); |
| 240 return true; | 239 return true; |
| 241 } | 240 } |
| 242 | 241 |
| 243 } // namespace browser_sync | 242 } // namespace browser_sync |
| OLD | NEW |