| 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/foreign_session_handler.h" | 5 #include "chrome/browser/ui/webui/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 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 13 #include "base/i18n/time_formatting.h" | 13 #include "base/i18n/time_formatting.h" |
| 14 #include "base/memory/scoped_vector.h" | |
| 15 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
| 16 #include "base/prefs/pref_service.h" | 15 #include "base/prefs/pref_service.h" |
| 17 #include "base/prefs/scoped_user_pref_update.h" | 16 #include "base/prefs/scoped_user_pref_update.h" |
| 18 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
| 19 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 20 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 21 #include "base/values.h" | 20 #include "base/values.h" |
| 22 #include "chrome/browser/chrome_notification_types.h" | 21 #include "chrome/browser/chrome_notification_types.h" |
| 23 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/browser/sessions/session_restore.h" | 23 #include "chrome/browser/sessions/session_restore.h" |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 // collapsed state persists. | 441 // collapsed state persists. |
| 443 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); | 442 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); |
| 444 DictionaryPrefUpdate update(prefs, prefs::kNtpCollapsedForeignSessions); | 443 DictionaryPrefUpdate update(prefs, prefs::kNtpCollapsedForeignSessions); |
| 445 if (is_collapsed) | 444 if (is_collapsed) |
| 446 update.Get()->SetBoolean(session_tag, true); | 445 update.Get()->SetBoolean(session_tag, true); |
| 447 else | 446 else |
| 448 update.Get()->Remove(session_tag, NULL); | 447 update.Get()->Remove(session_tag, NULL); |
| 449 } | 448 } |
| 450 | 449 |
| 451 } // namespace browser_sync | 450 } // namespace browser_sync |
| OLD | NEW |