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

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

Issue 8986007: Move WebUIMessageHandler to its own file in the public directory and put it in the content namesp... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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/browser/webui/web_ui.h"
22 #include "content/public/browser/notification_source.h" 23 #include "content/public/browser/notification_source.h"
23 24
24 namespace browser_sync { 25 namespace browser_sync {
25 26
26 // Maximum number of session we're going to display on the NTP 27 // Maximum number of session we're going to display on the NTP
27 static const int kMaxSessionsToShow = 10; 28 static const int kMaxSessionsToShow = 10;
28 29
29 // Invalid value, used to note that we don't have a tab or window number. 30 // Invalid value, used to note that we don't have a tab or window number.
30 static const int kInvalidId = -1; 31 static const int kInvalidId = -1;
31 32
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 return false; 236 return false;
236 dictionary->SetString("type", "window"); 237 dictionary->SetString("type", "window");
237 dictionary->SetDouble("timestamp", 238 dictionary->SetDouble("timestamp",
238 static_cast<double>(window.timestamp.ToInternalValue())); 239 static_cast<double>(window.timestamp.ToInternalValue()));
239 dictionary->SetInteger("sessionId", window.window_id.id()); 240 dictionary->SetInteger("sessionId", window.window_id.id());
240 dictionary->Set("tabs", tab_values.release()); 241 dictionary->Set("tabs", tab_values.release());
241 return true; 242 return true;
242 } 243 }
243 244
244 } // namespace browser_sync 245 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/foreign_session_handler.h ('k') | chrome/browser/ui/webui/ntp/most_visited_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698