blob: 862c9f27d0d54cdc5f82aba1b3c4f5a6f238522a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
// 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 "ui/app_list/app_list_switches.h"
#include "base/command_line.h"
#include "build/build_config.h"
namespace app_list {
namespace switches {
// Specifies the chrome-extension:// URL for the contents of an additional page
// added to the experimental app launcher.
const char kCustomLauncherPage[] = "custom-launcher-page";
// If set, the app list will not be dismissed when it loses focus. This is
// useful when testing the app list or a custom launcher page. It can still be
// dismissed via the other methods (like the Esc key).
const char kDisableAppListDismissOnBlur[] = "disable-app-list-dismiss-on-blur";
// If set, the app list will be enabled as if enabled from CWS.
const char kEnableAppList[] = "enable-app-list";
// If set, the app list will be centered and wide instead of tall.
const char kEnableCenteredAppList[] = "enable-centered-app-list";
// Enable/disable the experimental app list. If enabled, implies
// --enable-centered-app-list.
const char kEnableExperimentalAppList[] = "enable-experimental-app-list";
const char kDisableExperimentalAppList[] = "disable-experimental-app-list";
// Enable/disable syncing of the app list independent of extensions.
const char kEnableSyncAppList[] = "enable-sync-app-list";
const char kDisableSyncAppList[] = "disable-sync-app-list";
// Enable/disable drive search in chrome launcher.
const char kEnableDriveSearchInChromeLauncher[] =
"enable-drive-search-in-app-launcher";
const char kDisableDriveSearchInChromeLauncher[] =
"disable-drive-search-in-app-launcher";
// Enable/disable the new "blended" algorithm in app_list::Mixer. This is just
// forcing the AppListMixer/Blended field trial.
const char kEnableNewAppListMixer[] = "enable-new-app-list-mixer";
const char kDisableNewAppListMixer[] = "disable-new-app-list-mixer";
// If set, the app list will forget it has been installed on startup. Note this
// doesn't prevent the app list from running, it just makes Chrome think the app
// list hasn't been enabled (as in kEnableAppList) yet.
const char kResetAppListInstallState[] = "reset-app-list-install-state";
#if defined(OS_MACOSX)
// Enables use of the toolkit-views app list on Mac.
const char kEnableMacViewsAppList[] = "enable-mac-views-app-list";
#endif
bool IsAppListSyncEnabled() {
#if defined(OS_MACOSX)
if (base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableSyncAppList))
return true;
if (!IsMacViewsAppListEnabled())
return false;
#endif
return !base::CommandLine::ForCurrentProcess()->HasSwitch(
kDisableSyncAppList);
}
bool IsFolderUIEnabled() {
// Folder UI is available only when AppList sync is enabled, and should
// not be disabled separately.
return IsAppListSyncEnabled();
}
bool IsVoiceSearchEnabled() {
// Speech recognition in AppList is only for ChromeOS right now.
#if defined(OS_CHROMEOS)
return true;
#else
return false;
#endif
}
bool IsExperimentalAppListEnabled() {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
kEnableExperimentalAppList))
return true;
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
kDisableExperimentalAppList))
return false;
#if defined(OS_CHROMEOS)
return true;
#else
return false;
#endif
}
bool IsCenteredAppListEnabled() {
return base::CommandLine::ForCurrentProcess()->HasSwitch(
kEnableCenteredAppList) ||
IsExperimentalAppListEnabled();
}
bool ShouldNotDismissOnBlur() {
return base::CommandLine::ForCurrentProcess()->HasSwitch(
kDisableAppListDismissOnBlur);
}
bool IsDriveAppsInAppListEnabled() {
#if defined(OS_CHROMEOS)
return true;
#else
return false;
#endif
}
bool IsDriveSearchInChromeLauncherEnabled() {
#if defined(OS_CHROMEOS)
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
kEnableDriveSearchInChromeLauncher))
return true;
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
kDisableDriveSearchInChromeLauncher))
return false;
return true;
#else
return false;
#endif
}
#if defined(OS_MACOSX)
bool IsMacViewsAppListEnabled() {
#if defined(TOOLKIT_VIEWS)
return base::CommandLine::ForCurrentProcess()->HasSwitch(
kEnableMacViewsAppList);
#endif
return false;
}
#endif // defined(OS_MACOSX)
} // namespace switches
} // namespace app_list
|