Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: chrome/browser/ui/extensions/application_launch.cc

Issue 1209033008: Restore App window's size and maximized state from before it was closed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address stevenjb@'s comments. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 default app window.
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698