Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/extensions/application_launch.h" | 5 #include "chrome/browser/ui/extensions/application_launch.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "apps/launcher.h" | 9 #include "apps/launcher.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 153 extensions::LaunchContainer container, | 153 extensions::LaunchContainer container, |
| 154 const Extension* extension) { | 154 const Extension* extension) { |
| 155 if (!extension || container != extensions::LAUNCH_CONTAINER_WINDOW) | 155 if (!extension || container != extensions::LAUNCH_CONTAINER_WINDOW) |
| 156 return ui::SHOW_STATE_DEFAULT; | 156 return ui::SHOW_STATE_DEFAULT; |
| 157 | 157 |
| 158 if (chrome::IsRunningInForcedAppMode()) | 158 if (chrome::IsRunningInForcedAppMode()) |
| 159 return ui::SHOW_STATE_FULLSCREEN; | 159 return ui::SHOW_STATE_FULLSCREEN; |
| 160 | 160 |
| 161 #if defined(USE_ASH) | 161 #if defined(USE_ASH) |
| 162 // In ash, LAUNCH_TYPE_FULLSCREEN launches in a maximized app window and | 162 // In ash, LAUNCH_TYPE_FULLSCREEN launches in a maximized app window and |
| 163 // LAUNCH_TYPE_WINDOW launches in a normal app window. | 163 // LAUNCH_TYPE_WINDOW launches in a normal app window. |
|
stevenjb
2015/07/09 19:41:09
Update the comment.
xdai1
2015/07/09 22:46:46
Done.
| |
| 164 extensions::LaunchType launch_type = | 164 extensions::LaunchType launch_type = |
| 165 extensions::GetLaunchType(ExtensionPrefs::Get(profile), extension); | 165 extensions::GetLaunchType(ExtensionPrefs::Get(profile), extension); |
| 166 if (launch_type == extensions::LAUNCH_TYPE_FULLSCREEN) | 166 if (launch_type == extensions::LAUNCH_TYPE_FULLSCREEN) |
| 167 return ui::SHOW_STATE_MAXIMIZED; | 167 return ui::SHOW_STATE_MAXIMIZED; |
| 168 else if (launch_type == extensions::LAUNCH_TYPE_WINDOW) | 168 else if (launch_type == extensions::LAUNCH_TYPE_WINDOW) |
| 169 return ui::SHOW_STATE_NORMAL; | 169 return ui::SHOW_STATE_DEFAULT; |
| 170 #endif | 170 #endif |
| 171 | 171 |
| 172 return ui::SHOW_STATE_DEFAULT; | 172 return ui::SHOW_STATE_DEFAULT; |
| 173 } | 173 } |
| 174 | 174 |
| 175 WebContents* OpenApplicationWindow(const AppLaunchParams& params, | 175 WebContents* OpenApplicationWindow(const AppLaunchParams& params, |
| 176 const GURL& url) { | 176 const GURL& url) { |
| 177 Profile* const profile = params.profile; | 177 Profile* const profile = params.profile; |
| 178 const Extension* const extension = GetExtension(params); | 178 const Extension* const extension = GetExtension(params); |
| 179 | 179 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 412 extensions::TabHelper::FromWebContents(tab)->UpdateShortcutOnLoadComplete(); | 412 extensions::TabHelper::FromWebContents(tab)->UpdateShortcutOnLoadComplete(); |
| 413 | 413 |
| 414 return tab; | 414 return tab; |
| 415 } | 415 } |
| 416 | 416 |
| 417 bool CanLaunchViaEvent(const extensions::Extension* extension) { | 417 bool CanLaunchViaEvent(const extensions::Extension* extension) { |
| 418 const extensions::Feature* feature = | 418 const extensions::Feature* feature = |
| 419 extensions::FeatureProvider::GetAPIFeature("app.runtime"); | 419 extensions::FeatureProvider::GetAPIFeature("app.runtime"); |
| 420 return feature->IsAvailableToExtension(extension).is_available(); | 420 return feature->IsAvailableToExtension(extension).is_available(); |
| 421 } | 421 } |
| OLD | NEW |