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 @@ ...@@ -49,8 +49,8 @@
#include "ui/gfx/screen.h" #include "ui/gfx/screen.h"
#if !defined(OS_MACOSX) #if !defined(OS_MACOSX)
#include "apps/pref_names.h"
#include "base/prefs/pref_service.h" #include "base/prefs/pref_service.h"
#include "extensions/browser/pref_names.h"
#endif #endif
using content::BrowserContext; using content::BrowserContext;
...@@ -593,7 +593,7 @@ void AppWindow::SetFullscreen(FullscreenType type, bool enable) { ...@@ -593,7 +593,7 @@ void AppWindow::SetFullscreen(FullscreenType type, bool enable) {
PrefService* prefs = PrefService* prefs =
extensions::ExtensionsBrowserClient::Get()->GetPrefServiceForContext( extensions::ExtensionsBrowserClient::Get()->GetPrefServiceForContext(
browser_context()); browser_context());
if (!prefs->GetBoolean(prefs::kAppFullscreenAllowed)) if (!prefs->GetBoolean(extensions::pref_names::kAppFullscreenAllowed))
return; return;
} }
#endif #endif
......
...@@ -51,10 +51,6 @@ ...@@ -51,10 +51,6 @@
'launcher.cc', 'launcher.cc',
'launcher.h', 'launcher.h',
'metrics_names.h', 'metrics_names.h',
'pref_names.cc',
'pref_names.h',
'prefs.cc',
'prefs.h',
'saved_files_service.cc', 'saved_files_service.cc',
'saved_files_service.h', 'saved_files_service.h',
'saved_files_service_factory.cc', '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 @@ ...@@ -5,7 +5,6 @@
#include "chrome/browser/apps/app_launch_for_metro_restart_win.h" #include "chrome/browser/apps/app_launch_for_metro_restart_win.h"
#include "apps/launcher.h" #include "apps/launcher.h"
#include "apps/pref_names.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
......
...@@ -48,10 +48,6 @@ ...@@ -48,10 +48,6 @@
#include "chrome/browser/download/download_dir_policy_handler.h" #include "chrome/browser/download/download_dir_policy_handler.h"
#endif #endif
#if !defined(OS_MACOSX) && !defined(OS_IOS)
#include "apps/pref_names.h"
#endif
#if defined(ENABLE_EXTENSIONS) #if defined(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/api/messaging/native_messaging_policy_handler.h" #include "chrome/browser/extensions/api/messaging/native_messaging_policy_handler.h"
#include "chrome/browser/extensions/policy_handlers.h" #include "chrome/browser/extensions/policy_handlers.h"
...@@ -370,7 +366,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = { ...@@ -370,7 +366,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = {
base::Value::TYPE_BOOLEAN }, base::Value::TYPE_BOOLEAN },
#if defined(ENABLE_EXTENSIONS) #if defined(ENABLE_EXTENSIONS)
{ key::kFullscreenAllowed, { key::kFullscreenAllowed,
apps::prefs::kAppFullscreenAllowed, extensions::pref_names::kAppFullscreenAllowed,
base::Value::TYPE_BOOLEAN }, base::Value::TYPE_BOOLEAN },
#endif // defined(ENABLE_EXTENSIONS) #endif // defined(ENABLE_EXTENSIONS)
#endif // !defined(OS_MACOSX) && !defined(OS_IOS) #endif // !defined(OS_MACOSX) && !defined(OS_IOS)
......
...@@ -107,7 +107,6 @@ ...@@ -107,7 +107,6 @@
#endif #endif
#if defined(ENABLE_EXTENSIONS) #if defined(ENABLE_EXTENSIONS)
#include "apps/prefs.h"
#include "chrome/browser/extensions/activity_log/activity_log.h" #include "chrome/browser/extensions/activity_log/activity_log.h"
#include "chrome/browser/extensions/api/commands/command_service.h" #include "chrome/browser/extensions/api/commands/command_service.h"
#include "chrome/browser/extensions/api/tabs/tabs_api.h" #include "chrome/browser/extensions/api/tabs/tabs_api.h"
...@@ -404,7 +403,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { ...@@ -404,7 +403,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
#endif #endif
#if defined(ENABLE_EXTENSIONS) #if defined(ENABLE_EXTENSIONS)
apps::RegisterProfilePrefs(registry);
EasyUnlockService::RegisterProfilePrefs(registry); EasyUnlockService::RegisterProfilePrefs(registry);
extensions::ActivityLog::RegisterProfilePrefs(registry); extensions::ActivityLog::RegisterProfilePrefs(registry);
extensions::launch_util::RegisterProfilePrefs(registry); extensions::launch_util::RegisterProfilePrefs(registry);
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include <string> #include <string>
#include "apps/pref_names.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/metrics/histogram.h" #include "base/metrics/histogram.h"
......
...@@ -1995,6 +1995,12 @@ void ExtensionPrefs::RegisterProfilePrefs( ...@@ -1995,6 +1995,12 @@ void ExtensionPrefs::RegisterProfilePrefs(
kCorruptedDisableCount, kCorruptedDisableCount,
0, // default value 0, // default value
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#if !defined(OS_MACOSX)
registry->RegisterBooleanPref(
pref_names::kAppFullscreenAllowed, true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#endif
} }
template <class ExtensionIdContainer> template <class ExtensionIdContainer>
......
...@@ -30,6 +30,7 @@ bool ScopeToPrefName(ExtensionPrefsScope scope, std::string* result) { ...@@ -30,6 +30,7 @@ bool ScopeToPrefName(ExtensionPrefsScope scope, std::string* result) {
const char kAlertsInitialized[] = "extensions.alerts.initialized"; const char kAlertsInitialized[] = "extensions.alerts.initialized";
const char kAllowedInstallSites[] = "extensions.allowed_install_sites"; const char kAllowedInstallSites[] = "extensions.allowed_install_sites";
const char kAllowedTypes[] = "extensions.allowed_types"; const char kAllowedTypes[] = "extensions.allowed_types";
const char kAppFullscreenAllowed[] = "apps.fullscreen.allowed";
const char kBookmarkAppCreationLaunchType[] = const char kBookmarkAppCreationLaunchType[] =
"extensions.bookmark_app_creation_launch_type"; "extensions.bookmark_app_creation_launch_type";
const char kExtensions[] = "extensions.settings"; const char kExtensions[] = "extensions.settings";
......
...@@ -36,6 +36,9 @@ extern const char kAllowedInstallSites[]; ...@@ -36,6 +36,9 @@ extern const char kAllowedInstallSites[];
// kInstallForceList. // kInstallForceList.
extern const char kAllowedTypes[]; 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 // Integer which specifies the launch type that bookmark apps are created with
// by default. // by default.
extern const char kBookmarkAppCreationLaunchType[]; 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