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

Side by Side Diff: chrome/browser/ui/webui/ntp/foreign_session_handler.cc

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/bind.h" 10 #include "base/bind.h"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/memory/scoped_vector.h" 12 #include "base/memory/scoped_vector.h"
13 #include "base/string_number_conversions.h" 13 #include "base/string_number_conversions.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/sessions/session_restore.h" 17 #include "chrome/browser/sessions/session_restore.h"
18 #include "chrome/browser/sync/profile_sync_service.h" 18 #include "chrome/browser/sync/profile_sync_service.h"
19 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" 19 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
20 #include "chrome/common/chrome_notification_types.h" 20 #include "chrome/common/chrome_notification_types.h"
21 #include "chrome/common/url_constants.h" 21 #include "chrome/common/url_constants.h"
22 #include "content/common/notification_service.h" 22 #include "content/public/browser/notification_source.h"
23 #include "content/public/browser/notification_details.h"
24 23
25 namespace browser_sync { 24 namespace browser_sync {
26 25
27 // Maximum number of session we're going to display on the NTP 26 // Maximum number of session we're going to display on the NTP
28 static const int kMaxSessionsToShow = 10; 27 static const int kMaxSessionsToShow = 10;
29 28
30 // Invalid value, used to note that we don't have a tab or window number. 29 // Invalid value, used to note that we don't have a tab or window number.
31 static const int kInvalidId = -1; 30 static const int kInvalidId = -1;
32 31
33 ForeignSessionHandler::ForeignSessionHandler() { 32 ForeignSessionHandler::ForeignSessionHandler() {
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 return false; 235 return false;
237 dictionary->SetString("type", "window"); 236 dictionary->SetString("type", "window");
238 dictionary->SetDouble("timestamp", 237 dictionary->SetDouble("timestamp",
239 static_cast<double>(window.timestamp.ToInternalValue())); 238 static_cast<double>(window.timestamp.ToInternalValue()));
240 dictionary->SetInteger("sessionId", window.window_id.id()); 239 dictionary->SetInteger("sessionId", window.window_id.id());
241 dictionary->Set("tabs", tab_values.release()); 240 dictionary->Set("tabs", tab_values.release());
242 return true; 241 return true;
243 } 242 }
244 243
245 } // namespace browser_sync 244 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/bookmarks_handler.cc ('k') | chrome/browser/ui/webui/ntp/new_tab_page_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698