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

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

Issue 1405383006: [sync] Componentize strings used by ProfileSyncService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pss_switches_strings
Patch Set: Rebase Created 5 years, 1 month 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
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/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/metrics/histogram_macros.h" 14 #include "base/metrics/histogram_macros.h"
15 #include "base/prefs/pref_service.h" 15 #include "base/prefs/pref_service.h"
16 #include "base/prefs/scoped_user_pref_update.h" 16 #include "base/prefs/scoped_user_pref_update.h"
17 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.h"
18 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
19 #include "base/time/time.h" 19 #include "base/time/time.h"
20 #include "base/values.h" 20 #include "base/values.h"
21 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/browser/sessions/session_restore.h" 22 #include "chrome/browser/sessions/session_restore.h"
23 #include "chrome/browser/sync/profile_sync_service.h" 23 #include "chrome/browser/sync/profile_sync_service.h"
24 #include "chrome/browser/sync/profile_sync_service_factory.h" 24 #include "chrome/browser/sync/profile_sync_service_factory.h"
25 #include "chrome/browser/ui/host_desktop.h" 25 #include "chrome/browser/ui/host_desktop.h"
26 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" 26 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
27 #include "chrome/common/pref_names.h" 27 #include "chrome/common/pref_names.h"
28 #include "chrome/common/url_constants.h" 28 #include "chrome/common/url_constants.h"
29 #include "chrome/grit/generated_resources.h"
30 #include "components/pref_registry/pref_registry_syncable.h" 29 #include "components/pref_registry/pref_registry_syncable.h"
30 #include "components/strings/grit/components_strings.h"
31 #include "content/public/browser/url_data_source.h" 31 #include "content/public/browser/url_data_source.h"
32 #include "content/public/browser/web_contents.h" 32 #include "content/public/browser/web_contents.h"
33 #include "content/public/browser/web_ui.h" 33 #include "content/public/browser/web_ui.h"
34 #include "ui/base/l10n/l10n_util.h" 34 #include "ui/base/l10n/l10n_util.h"
35 #include "ui/base/l10n/time_format.h" 35 #include "ui/base/l10n/time_format.h"
36 #include "ui/base/webui/web_ui_util.h" 36 #include "ui/base/webui/web_ui_util.h"
37 37
38 namespace browser_sync { 38 namespace browser_sync {
39 39
40 namespace { 40 namespace {
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 // collapsed state persists. 428 // collapsed state persists.
429 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); 429 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs();
430 DictionaryPrefUpdate update(prefs, prefs::kNtpCollapsedForeignSessions); 430 DictionaryPrefUpdate update(prefs, prefs::kNtpCollapsedForeignSessions);
431 if (is_collapsed) 431 if (is_collapsed)
432 update.Get()->SetBoolean(session_tag, true); 432 update.Get()->SetBoolean(session_tag, true);
433 else 433 else
434 update.Get()->Remove(session_tag, NULL); 434 update.Get()->Remove(session_tag, NULL);
435 } 435 }
436 436
437 } // namespace browser_sync 437 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_unittest.cc ('k') | components/browser_sync_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698