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

Unified Diff: chrome/browser/ui/extensions/application_launch.cc

Issue 10949023: Add switch to provide app window size on startup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove hack Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/extensions/application_launch.cc
diff --git a/chrome/browser/ui/extensions/application_launch.cc b/chrome/browser/ui/extensions/application_launch.cc
index 0e1e4e9bff16fdbe8ffd77d8e77fde4f333448ee..e912d0971dc4cfca8cbb2628bf53f3decc963461 100644
--- a/chrome/browser/ui/extensions/application_launch.cc
+++ b/chrome/browser/ui/extensions/application_launch.cc
@@ -29,6 +29,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/public/common/renderer_preferences.h"
+#include "ui/gfx/rect.h"
using content::WebContents;
using extensions::Extension;
@@ -68,7 +69,8 @@ WebContents* OpenApplicationWindow(
const Extension* extension,
extension_misc::LaunchContainer container,
const GURL& url_input,
- Browser** app_browser) {
+ Browser** app_browser,
+ const gfx::Rect& override_bounds) {
DCHECK(!url_input.is_empty() || extension);
GURL url = UrlForExtension(extension, url_input);
@@ -83,6 +85,8 @@ WebContents* OpenApplicationWindow(
if (extension) {
window_bounds.set_width(extension->launch_width());
window_bounds.set_height(extension->launch_height());
+ } else if (!override_bounds.IsEmpty()) {
+ window_bounds = override_bounds;
}
Browser::CreateParams params(type, profile);
@@ -255,7 +259,7 @@ WebContents* OpenApplication(const LaunchParams& params) {
case extension_misc::LAUNCH_PANEL:
case extension_misc::LAUNCH_WINDOW:
tab = OpenApplicationWindow(profile, extension, container,
- override_url, NULL);
+ override_url, NULL, gfx::Rect());
break;
case extension_misc::LAUNCH_TAB: {
tab = OpenApplicationTab(profile, extension, override_url,
@@ -270,14 +274,16 @@ WebContents* OpenApplication(const LaunchParams& params) {
}
WebContents* OpenAppShortcutWindow(Profile* profile,
- const GURL& url) {
+ const GURL& url,
+ const gfx::Rect& override_bounds) {
Browser* app_browser;
WebContents* tab = OpenApplicationWindow(
profile,
NULL, // this is a URL app. No extension.
extension_misc::LAUNCH_WINDOW,
url,
- &app_browser);
+ &app_browser,
+ override_bounds);
if (!tab)
return NULL;
« no previous file with comments | « chrome/browser/ui/extensions/application_launch.h ('k') | chrome/browser/ui/startup/startup_browser_creator_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698