Commit 77b343e0 authored by hashimoto's avatar hashimoto Committed by Commit bot

Merge apps/pref* to extensions/browser/pref*

The pref's exclusive user AppWindow will move to extensions/browser

Merge apps/pref_names.{cc,h} to extensions/browser/pref_names.{cc,h}
Merge apps/prefs.{cc,h} to extensions/browser/extension_prefs.cc

BUG=403726
TBR=bartfab@chromium.org for include fix in configuration_policy_handler_list_factory.cc.

Review URL: https://codereview.chromium.org/493003002

Cr-Commit-Position: refs/heads/master@{#291650}
parent f51f1160
......@@ -49,8 +49,8 @@
#include "ui/gfx/screen.h"
#if !defined(OS_MACOSX)
#include "apps/pref_names.h"
#include "base/prefs/pref_service.h"
#include "extensions/browser/pref_names.h"
#endif
using content::BrowserContext;
......@@ -593,7 +593,7 @@ void AppWindow::SetFullscreen(FullscreenType type, bool enable) {
PrefService* prefs =
extensions::ExtensionsBrowserClient::Get()->GetPrefServiceForContext(
browser_context());
if (!prefs->GetBoolean(prefs::kAppFullscreenAllowed))
if (!prefs->GetBoolean(extensions::pref_names::kAppFullscreenAllowed))
return;
}
#endif
......
......@@ -51,10 +51,6 @@
'launcher.cc',
'launcher.h',
'metrics_names.h',
'pref_names.cc',
'pref_names.h',
'prefs.cc',
'prefs.h',
'saved_files_service.cc',
'saved_files_service.h',
'saved_files_service_factory.cc',
......
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "apps/pref_names.h"
namespace apps {
namespace prefs {
// A boolean that tracks whether apps are allowed to enter fullscreen mode.
extern const char kAppFullscreenAllowed[] =
"apps.fullscreen.allowed";
} // namespace prefs
} // namespace apps
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef APPS_PREF_NAMES_H_
#define APPS_PREF_NAMES_H_
namespace apps {
namespace prefs {
// Alphabetical list of preference names specific to Apps component.
// Keep alphabetized and document each one in the source file.
extern const char kAppFullscreenAllowed[];
} // namespace prefs
} // namespace apps
#endif // APPS_PREF_NAMES_H_
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "apps/prefs.h"
#include "apps/pref_names.h"
#include "base/prefs/pref_registry_simple.h"
#include "components/pref_registry/pref_registry_syncable.h"
namespace apps {
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
#if !defined(OS_MACOSX)
registry->RegisterBooleanPref(
prefs::kAppFullscreenAllowed, true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#endif
}
} // namespace apps
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef APPS_PREFS_H_
#define APPS_PREFS_H_
class PrefRegistrySimple;
namespace user_prefs {
class PrefRegistrySyncable;
}
namespace apps {
// Register per-profile preferences for the apps system.
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
} // namespace apps
#endif // APPS_PREFS_H_
......@@ -5,7 +5,6 @@
#include "chrome/browser/apps/app_launch_for_metro_restart_win.h"
#include "apps/launcher.h"
#include "apps/pref_names.h"
#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/message_loop/message_loop.h"
......
......@@ -48,10 +48,6 @@
#include "chrome/browser/download/download_dir_policy_handler.h"
#endif
#if !defined(OS_MACOSX) && !defined(OS_IOS)
#include "apps/pref_names.h"
#endif
#if defined(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/api/messaging/native_messaging_policy_handler.h"
#include "chrome/browser/extensions/policy_handlers.h"
......@@ -370,7 +366,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = {
base::Value::TYPE_BOOLEAN },
#if defined(ENABLE_EXTENSIONS)
{ key::kFullscreenAllowed,
apps::prefs::kAppFullscreenAllowed,
extensions::pref_names::kAppFullscreenAllowed,
base::Value::TYPE_BOOLEAN },
#endif // defined(ENABLE_EXTENSIONS)
#endif // !defined(OS_MACOSX) && !defined(OS_IOS)
......
......@@ -107,7 +107,6 @@
#endif
#if defined(ENABLE_EXTENSIONS)
#include "apps/prefs.h"
#include "chrome/browser/extensions/activity_log/activity_log.h"
#include "chrome/browser/extensions/api/commands/command_service.h"
#include "chrome/browser/extensions/api/tabs/tabs_api.h"
......@@ -404,7 +403,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
#endif
#if defined(ENABLE_EXTENSIONS)
apps::RegisterProfilePrefs(registry);
EasyUnlockService::RegisterProfilePrefs(registry);
extensions::ActivityLog::RegisterProfilePrefs(registry);
extensions::launch_util::RegisterProfilePrefs(registry);
......
......@@ -6,7 +6,6 @@
#include <string>
#include "apps/pref_names.h"
#include "base/bind.h"
#include "base/command_line.h"
#include "base/metrics/histogram.h"
......
......@@ -1995,6 +1995,12 @@ void ExtensionPrefs::RegisterProfilePrefs(
kCorruptedDisableCount,
0, // default value
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#if !defined(OS_MACOSX)
registry->RegisterBooleanPref(
pref_names::kAppFullscreenAllowed, true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#endif
}
template <class ExtensionIdContainer>
......
......@@ -30,6 +30,7 @@ bool ScopeToPrefName(ExtensionPrefsScope scope, std::string* result) {
const char kAlertsInitialized[] = "extensions.alerts.initialized";
const char kAllowedInstallSites[] = "extensions.allowed_install_sites";
const char kAllowedTypes[] = "extensions.allowed_types";
const char kAppFullscreenAllowed[] = "apps.fullscreen.allowed";
const char kBookmarkAppCreationLaunchType[] =
"extensions.bookmark_app_creation_launch_type";
const char kExtensions[] = "extensions.settings";
......
......@@ -36,6 +36,9 @@ extern const char kAllowedInstallSites[];
// kInstallForceList.
extern const char kAllowedTypes[];
// A boolean that tracks whether apps are allowed to enter fullscreen mode.
extern const char kAppFullscreenAllowed[];
// Integer which specifies the launch type that bookmark apps are created with
// by default.
extern const char kBookmarkAppCreationLaunchType[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment