blob: 95555bacc6183b7f8fa12710d4ef87582a3ff3d3 [file] [log] [blame]
[email protected]10951eb2012-05-08 22:12:511// 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
3// found in the LICENSE file.
4
5#include "chrome/browser/ui/browser_view_prefs.h"
6
avi655876a2015-12-25 07:18:157#include "build/build_config.h"
[email protected]10951eb2012-05-08 22:12:518#include "chrome/common/pref_names.h"
[email protected]f0c8c4992014-05-15 17:37:269#include "components/pref_registry/pref_registry_syncable.h"
brettwb1fc1b82016-02-02 00:19:0810#include "components/prefs/pref_registry_simple.h"
11#include "components/prefs/pref_service.h"
[email protected]10951eb2012-05-08 22:12:5112
[email protected]c600bce2014-02-21 17:37:1013#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
brettw3ac5672b2016-09-19 21:41:3714#include "ui/base/x/x11_util.h" // nogncheck
[email protected]c600bce2014-02-21 17:37:1015#endif
16
[email protected]10951eb2012-05-08 22:12:5117namespace {
18
[email protected]7f70e5f2014-05-29 19:28:1619// DEPRECATED: this is replaced by kTabStripStackedLayout and exists for
20// backwards compatibility.
21// Old values: 0 = SHRINK (default), 1 = STACKED.
22const char kTabStripLayoutType[] = "tab_strip_layout_type";
23
[email protected]10951eb2012-05-08 22:12:5124} // namespace
25
[email protected]684dace42012-07-01 14:30:4126namespace chrome {
[email protected]10951eb2012-05-08 22:12:5127
[email protected]af97be4c62014-02-13 14:43:3428void RegisterBrowserViewLocalPrefs(PrefRegistrySimple* registry) {
[email protected]7f70e5f2014-05-29 19:28:1629 registry->RegisterIntegerPref(kTabStripLayoutType, 0);
30 registry->RegisterBooleanPref(prefs::kTabStripStackedLayout, false);
[email protected]10951eb2012-05-08 22:12:5131}
32
[email protected]af97be4c62014-02-13 14:43:3433void RegisterBrowserViewProfilePrefs(
34 user_prefs::PrefRegistrySyncable* registry) {
tonikitoof2f307b02016-10-26 21:53:5135#if !defined(OS_CHROMEOS) && defined(USE_X11)
raymesaa608722015-04-27 03:00:2536 registry->RegisterBooleanPref(prefs::kUseCustomChromeFrame,
dbeam5acada552016-07-07 00:45:4537 ui::GetCustomFramePrefDefault());
38#endif
pkasting36aa72942016-06-10 05:49:0839
40 registry->RegisterIntegerPref(
41 prefs::kBackShortcutBubbleShownCount, 0,
42 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
[email protected]af97be4c62014-02-13 14:43:3443}
44
[email protected]7f70e5f2014-05-29 19:28:1645void MigrateBrowserTabStripPrefs(PrefService* prefs) {
46 if (prefs->HasPrefPath(kTabStripLayoutType)) {
47 prefs->SetBoolean(prefs::kTabStripStackedLayout,
48 prefs->GetInteger(kTabStripLayoutType) != 0);
49 prefs->ClearPref(kTabStripLayoutType);
50 }
51}
52
[email protected]684dace42012-07-01 14:30:4153} // namespace chrome