| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |