OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/launch_util.h" | 5 #include "chrome/browser/extensions/launch_util.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/extensions/extension_sync_service.h" | 8 #include "chrome/browser/extensions/extension_sync_service.h" |
9 #include "chrome/browser/extensions/extension_util.h" | 9 #include "chrome/browser/extensions/extension_util.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // Look for prefs that indicate the user's choice of launch container. The | 111 // Look for prefs that indicate the user's choice of launch container. The |
112 // app's menu on the NTP provides a UI to set this preference. | 112 // app's menu on the NTP provides a UI to set this preference. |
113 LaunchType prefs_launch_type = GetLaunchType(prefs, extension); | 113 LaunchType prefs_launch_type = GetLaunchType(prefs, extension); |
114 | 114 |
115 if (prefs_launch_type == LAUNCH_TYPE_WINDOW) { | 115 if (prefs_launch_type == LAUNCH_TYPE_WINDOW) { |
116 // If the pref is set to launch a window (or no pref is set, and | 116 // If the pref is set to launch a window (or no pref is set, and |
117 // window opening is the default), make the container a window. | 117 // window opening is the default), make the container a window. |
118 result = LAUNCH_CONTAINER_WINDOW; | 118 result = LAUNCH_CONTAINER_WINDOW; |
119 #if defined(USE_ASH) | 119 #if defined(USE_ASH) |
120 } else if (prefs_launch_type == LAUNCH_TYPE_FULLSCREEN && | 120 } else if (prefs_launch_type == LAUNCH_TYPE_FULLSCREEN && |
121 chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) { | 121 chrome::GetActiveDesktop() == ui::HOST_DESKTOP_TYPE_ASH) { |
122 // LAUNCH_TYPE_FULLSCREEN launches in a maximized app window in ash. | 122 // LAUNCH_TYPE_FULLSCREEN launches in a maximized app window in ash. |
123 // For desktop chrome AURA on all platforms we should open the | 123 // For desktop chrome AURA on all platforms we should open the |
124 // application in full screen mode in the current tab, on the same | 124 // application in full screen mode in the current tab, on the same |
125 // lines as non AURA chrome. | 125 // lines as non AURA chrome. |
126 result = LAUNCH_CONTAINER_WINDOW; | 126 result = LAUNCH_CONTAINER_WINDOW; |
127 #endif | 127 #endif |
128 } else { | 128 } else { |
129 // All other launch types (tab, pinned, fullscreen) are | 129 // All other launch types (tab, pinned, fullscreen) are |
130 // implemented as tabs in a window. | 130 // implemented as tabs in a window. |
131 result = LAUNCH_CONTAINER_TAB; | 131 result = LAUNCH_CONTAINER_TAB; |
(...skipping 23 matching lines...) Expand all Loading... |
155 prefs->ReadPrefAsInteger(extension->id(), kPrefLaunchType, &value); | 155 prefs->ReadPrefAsInteger(extension->id(), kPrefLaunchType, &value); |
156 } | 156 } |
157 | 157 |
158 bool LaunchesInWindow(content::BrowserContext* context, | 158 bool LaunchesInWindow(content::BrowserContext* context, |
159 const Extension* extension) { | 159 const Extension* extension) { |
160 return GetLaunchType(ExtensionPrefs::Get(context), extension) == | 160 return GetLaunchType(ExtensionPrefs::Get(context), extension) == |
161 LAUNCH_TYPE_WINDOW; | 161 LAUNCH_TYPE_WINDOW; |
162 } | 162 } |
163 | 163 |
164 } // namespace extensions | 164 } // namespace extensions |
OLD | NEW |