Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ui / app_list / app_list_switches.cc
1 // Copyright 2013 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 "ui/app_list/app_list_switches.h"
6
7 #include "base/command_line.h"
8
9 namespace app_list {
10 namespace switches {
11
12 // Specifies the chrome-extension:// URL for the contents of an additional page
13 // added to the experimental app launcher.
14 const char kCustomLauncherPage[] = "custom-launcher-page";
15
16 // If set, the app info context menu item is not available in the app list UI.
17 const char kDisableAppInfo[] = "disable-app-list-app-info";
18
19 // If set, the app list will not be dismissed when it loses focus. This is
20 // useful when testing the app list or a custom launcher page. It can still be
21 // dismissed via the other methods (like the Esc key).
22 const char kDisableAppListDismissOnBlur[] = "disable-app-list-dismiss-on-blur";
23
24 // If set, Drive apps will not be shown side-by-side with Chrome apps.
25 const char kDisableDriveAppsInAppList[] = "disable-drive-apps-in-app-list";
26
27 // Disables syncing of the app list independent of extensions.
28 const char kDisableSyncAppList[] = "disable-sync-app-list";
29
30 // If set, the app list will be centered and wide instead of tall.
31 const char kEnableCenteredAppList[] = "enable-centered-app-list";
32
33 // If set, the experimental app list will be used. Implies
34 // --enable-centered-app-list.
35 const char kEnableExperimentalAppList[] = "enable-experimental-app-list";
36
37 // Enables syncing of the app list independent of extensions.
38 const char kEnableSyncAppList[] = "enable-sync-app-list";
39
40 bool IsAppListSyncEnabled() {
41 #if defined(TOOLKIT_VIEWS)
42   return !CommandLine::ForCurrentProcess()->HasSwitch(kDisableSyncAppList);
43 #else
44   return CommandLine::ForCurrentProcess()->HasSwitch(kEnableSyncAppList);
45 #endif
46 }
47
48 bool IsFolderUIEnabled() {
49 #if !defined(TOOLKIT_VIEWS)
50   return false;  // Folder UI not implemented for Cocoa.
51 #endif
52   // Folder UI is available only when AppList sync is enabled, and should
53   // not be disabled separately.
54   return IsAppListSyncEnabled();
55 }
56
57 bool IsVoiceSearchEnabled() {
58   // Speech recognition in AppList is only for ChromeOS right now.
59 #if defined(OS_CHROMEOS)
60   return true;
61 #else
62   return false;
63 #endif
64 }
65
66 bool IsAppInfoEnabled() {
67 #if defined(TOOLKIT_VIEWS)
68   return !CommandLine::ForCurrentProcess()->HasSwitch(kDisableAppInfo);
69 #else
70   return false;
71 #endif
72 }
73
74 bool IsExperimentalAppListEnabled() {
75   return CommandLine::ForCurrentProcess()->HasSwitch(
76       kEnableExperimentalAppList);
77 }
78
79 bool IsCenteredAppListEnabled() {
80   return CommandLine::ForCurrentProcess()->HasSwitch(kEnableCenteredAppList) ||
81          IsExperimentalAppListEnabled();
82 }
83
84 bool ShouldNotDismissOnBlur() {
85   return CommandLine::ForCurrentProcess()->HasSwitch(
86       kDisableAppListDismissOnBlur);
87 }
88
89 bool IsDriveAppsInAppListEnabled() {
90 #if defined(OS_CHROMEOS)
91   return !CommandLine::ForCurrentProcess()->HasSwitch(
92       kDisableDriveAppsInAppList);
93 #else
94   return false;
95 #endif
96 }
97
98 }  // namespace switches
99 }  // namespace app_list