| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/webui/ntp/foreign_session_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/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/memory/scoped_vector.h" | 10 #include "base/memory/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/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/sessions/session_restore.h" | 15 #include "chrome/browser/sessions/session_restore.h" |
| 16 #include "chrome/browser/sync/engine/syncapi.h" | |
| 17 #include "chrome/browser/sync/profile_sync_service.h" | 16 #include "chrome/browser/sync/profile_sync_service.h" |
| 18 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 17 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
| 19 #include "chrome/common/chrome_notification_types.h" | 18 #include "chrome/common/chrome_notification_types.h" |
| 19 #include "chrome/common/url_constants.h" |
| 20 #include "content/common/notification_details.h" | 20 #include "content/common/notification_details.h" |
| 21 #include "content/common/notification_service.h" | 21 #include "content/common/notification_service.h" |
| 22 #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. |
| 30 static const int kInvalidId = -1; | 29 static const int kInvalidId = -1; |
| 31 | 30 |
| 32 ForeignSessionHandler::ForeignSessionHandler() { | 31 ForeignSessionHandler::ForeignSessionHandler() { |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 return false; | 232 return false; |
| 234 dictionary->SetString("type", "window"); | 233 dictionary->SetString("type", "window"); |
| 235 dictionary->SetDouble("timestamp", | 234 dictionary->SetDouble("timestamp", |
| 236 static_cast<double>(window.timestamp.ToInternalValue())); | 235 static_cast<double>(window.timestamp.ToInternalValue())); |
| 237 dictionary->SetInteger("sessionId", window.window_id.id()); | 236 dictionary->SetInteger("sessionId", window.window_id.id()); |
| 238 dictionary->Set("tabs", tab_values.release()); | 237 dictionary->Set("tabs", tab_values.release()); |
| 239 return true; | 238 return true; |
| 240 } | 239 } |
| 241 | 240 |
| 242 } // namespace browser_sync | 241 } // namespace browser_sync |
| OLD | NEW |