OLD | NEW |
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 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::RegisterProfilePrefs( | 59 void ForeignSessionHandler::RegisterProfilePrefs( |
60 user_prefs::PrefRegistrySyncable* registry) { | 60 user_prefs::PrefRegistrySyncable* registry) { |
61 registry->RegisterDictionaryPref( | 61 registry->RegisterDictionaryPref(prefs::kNtpCollapsedForeignSessions); |
62 prefs::kNtpCollapsedForeignSessions, | |
63 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
64 } | 62 } |
65 | 63 |
66 // static | 64 // static |
67 void ForeignSessionHandler::OpenForeignSessionTab( | 65 void ForeignSessionHandler::OpenForeignSessionTab( |
68 content::WebUI* web_ui, | 66 content::WebUI* web_ui, |
69 const std::string& session_string_value, | 67 const std::string& session_string_value, |
70 SessionID::id_type window_num, | 68 SessionID::id_type window_num, |
71 SessionID::id_type tab_id, | 69 SessionID::id_type tab_id, |
72 const WindowOpenDisposition& disposition) { | 70 const WindowOpenDisposition& disposition) { |
73 OpenTabsUIDelegate* open_tabs = GetOpenTabsUIDelegate(web_ui); | 71 OpenTabsUIDelegate* open_tabs = GetOpenTabsUIDelegate(web_ui); |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 last_synced < base::TimeDelta::FromMinutes(1) ? | 414 last_synced < base::TimeDelta::FromMinutes(1) ? |
417 l10n_util::GetStringUTF16(IDS_SYNC_TIME_JUST_NOW) : | 415 l10n_util::GetStringUTF16(IDS_SYNC_TIME_JUST_NOW) : |
418 ui::TimeFormat::Simple(ui::TimeFormat::FORMAT_ELAPSED, | 416 ui::TimeFormat::Simple(ui::TimeFormat::FORMAT_ELAPSED, |
419 ui::TimeFormat::LENGTH_SHORT, last_synced)); | 417 ui::TimeFormat::LENGTH_SHORT, last_synced)); |
420 dictionary->SetInteger("sessionId", window.window_id.id()); | 418 dictionary->SetInteger("sessionId", window.window_id.id()); |
421 dictionary->Set("tabs", tab_values.release()); | 419 dictionary->Set("tabs", tab_values.release()); |
422 return true; | 420 return true; |
423 } | 421 } |
424 | 422 |
425 } // namespace browser_sync | 423 } // namespace browser_sync |
OLD | NEW |