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

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

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again, previous had unrelated broken win_rel test. Created 8 years 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) 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/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"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 bool SortSessionsByRecency(const SyncedSession* s1, const SyncedSession* s2) { 49 bool SortSessionsByRecency(const SyncedSession* s1, const SyncedSession* s2) {
50 return s1->modified_time > s2->modified_time; 50 return s1->modified_time > s2->modified_time;
51 } 51 }
52 52
53 } // namepace 53 } // namepace
54 54
55 ForeignSessionHandler::ForeignSessionHandler() { 55 ForeignSessionHandler::ForeignSessionHandler() {
56 } 56 }
57 57
58 // static 58 // static
59 void ForeignSessionHandler::RegisterUserPrefs(PrefService* prefs) { 59 void ForeignSessionHandler::RegisterUserPrefs(PrefServiceSyncable* prefs) {
60 prefs->RegisterDictionaryPref(prefs::kNtpCollapsedForeignSessions, 60 prefs->RegisterDictionaryPref(prefs::kNtpCollapsedForeignSessions,
61 PrefService::UNSYNCABLE_PREF); 61 PrefServiceSyncable::UNSYNCABLE_PREF);
62 } 62 }
63 63
64 // static 64 // static
65 void ForeignSessionHandler::OpenForeignSessionTab( 65 void ForeignSessionHandler::OpenForeignSessionTab(
66 content::WebUI* web_ui, 66 content::WebUI* web_ui,
67 const std::string& session_string_value, 67 const std::string& session_string_value,
68 SessionID::id_type window_num, 68 SessionID::id_type window_num,
69 SessionID::id_type tab_id, 69 SessionID::id_type tab_id,
70 const WindowOpenDisposition& disposition) { 70 const WindowOpenDisposition& disposition) {
71 SessionModelAssociator* associator = GetModelAssociator(web_ui); 71 SessionModelAssociator* associator = GetModelAssociator(web_ui);
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 dictionary->SetString("userVisibleTimestamp", 429 dictionary->SetString("userVisibleTimestamp",
430 last_synced < base::TimeDelta::FromMinutes(1) ? 430 last_synced < base::TimeDelta::FromMinutes(1) ?
431 l10n_util::GetStringUTF16(IDS_SYNC_TIME_JUST_NOW) : 431 l10n_util::GetStringUTF16(IDS_SYNC_TIME_JUST_NOW) :
432 TimeFormat::TimeElapsed(last_synced)); 432 TimeFormat::TimeElapsed(last_synced));
433 dictionary->SetInteger("sessionId", window.window_id.id()); 433 dictionary->SetInteger("sessionId", window.window_id.id());
434 dictionary->Set("tabs", tab_values.release()); 434 dictionary->Set("tabs", tab_values.release());
435 return true; 435 return true;
436 } 436 }
437 437
438 } // namespace browser_sync 438 } // 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