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

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

Issue 10699057: Move application creation and extension install prompt showing off Browser and onto ExtensionTabHel… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "chrome/browser/extensions/default_apps_trial.h" 10 #include "chrome/browser/extensions/default_apps_trial.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 profile, 238 profile,
239 NULL, // this is a URL app. No extension. 239 NULL, // this is a URL app. No extension.
240 extension_misc::LAUNCH_WINDOW, 240 extension_misc::LAUNCH_WINDOW,
241 url, 241 url,
242 &app_browser); 242 &app_browser);
243 243
244 if (!tab) 244 if (!tab)
245 return NULL; 245 return NULL;
246 246
247 if (update_shortcut) { 247 if (update_shortcut) {
248 TabContents* tab_contents = TabContents::FromWebContents(tab);
248 // Set UPDATE_SHORTCUT as the pending web app action. This action is picked 249 // Set UPDATE_SHORTCUT as the pending web app action. This action is picked
249 // up in LoadingStateChanged to schedule a GetApplicationInfo. And when 250 // up in LoadingStateChanged to schedule a GetApplicationInfo. And when
250 // the web app info is available, ExtensionTabHelper notifies Browser via 251 // the web app info is available, ExtensionTabHelper notifies Browser via
251 // OnDidGetApplicationInfo, which calls 252 // OnDidGetApplicationInfo, which calls
252 // web_app::UpdateShortcutForTabContents when it sees UPDATE_SHORTCUT as 253 // web_app::UpdateShortcutForTabContents when it sees UPDATE_SHORTCUT as
253 // pending web app action. 254 // pending web app action.
254 app_browser->set_pending_web_app_action(Browser::UPDATE_SHORTCUT); 255 tab_contents->extension_tab_helper()->set_pending_web_app_action(
256 ExtensionTabHelper::UPDATE_SHORTCUT);
255 } 257 }
256 return tab; 258 return tab;
257 } 259 }
258 260
259 WebContents* OpenApplicationTab(Profile* profile, 261 WebContents* OpenApplicationTab(Profile* profile,
260 const Extension* extension, 262 const Extension* extension,
261 const GURL& override_url, 263 const GURL& override_url,
262 WindowOpenDisposition disposition) { 264 WindowOpenDisposition disposition) {
263 Browser* browser = browser::FindTabbedBrowser(profile, false); 265 Browser* browser = browser::FindTabbedBrowser(profile, false);
264 WebContents* contents = NULL; 266 WebContents* contents = NULL;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 if (launch_type == ExtensionPrefs::LAUNCH_FULLSCREEN && 343 if (launch_type == ExtensionPrefs::LAUNCH_FULLSCREEN &&
342 !browser->window()->IsFullscreen()) { 344 !browser->window()->IsFullscreen()) {
343 browser->ToggleFullscreenMode(); 345 browser->ToggleFullscreenMode();
344 } 346 }
345 #endif 347 #endif
346 348
347 return contents; 349 return contents;
348 } 350 }
349 351
350 } // namespace application_launch 352 } // namespace application_launch
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698