| 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/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "chrome/browser/event_disposition.h" | |
| 10 #include "chrome/browser/extensions/extension_prefs.h" | 9 #include "chrome/browser/extensions/extension_prefs.h" |
| 11 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| 12 #include "chrome/browser/extensions/extension_system.h" | 11 #include "chrome/browser/extensions/extension_system.h" |
| 13 #include "chrome/browser/extensions/platform_app_launcher.h" | 12 #include "chrome/browser/extensions/platform_app_launcher.h" |
| 14 #include "chrome/browser/extensions/tab_helper.h" | 13 #include "chrome/browser/extensions/tab_helper.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 17 #include "chrome/browser/ui/browser_commands.h" | 16 #include "chrome/browser/ui/browser_commands.h" |
| 18 #include "chrome/browser/ui/browser_finder.h" | 17 #include "chrome/browser/ui/browser_finder.h" |
| 19 #include "chrome/browser/ui/browser_tabstrip.h" | 18 #include "chrome/browser/ui/browser_tabstrip.h" |
| 20 #include "chrome/browser/ui/browser_window.h" | 19 #include "chrome/browser/ui/browser_window.h" |
| 21 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 20 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 22 #include "chrome/browser/web_applications/web_app.h" | 21 #include "chrome/browser/web_applications/web_app.h" |
| 23 #include "chrome/common/chrome_switches.h" | 22 #include "chrome/common/chrome_switches.h" |
| 24 #include "chrome/common/extensions/extension.h" | 23 #include "chrome/common/extensions/extension.h" |
| 25 #include "chrome/common/extensions/extension_constants.h" | 24 #include "chrome/common/extensions/extension_constants.h" |
| 26 #include "chrome/common/extensions/manifest_url_handler.h" | 25 #include "chrome/common/extensions/manifest_url_handler.h" |
| 27 #include "chrome/common/url_constants.h" | 26 #include "chrome/common/url_constants.h" |
| 28 #include "content/public/browser/render_view_host.h" | 27 #include "content/public/browser/render_view_host.h" |
| 29 #include "content/public/browser/web_contents.h" | 28 #include "content/public/browser/web_contents.h" |
| 30 #include "content/public/browser/web_contents_view.h" | 29 #include "content/public/browser/web_contents_view.h" |
| 31 #include "content/public/common/renderer_preferences.h" | 30 #include "content/public/common/renderer_preferences.h" |
| 31 #include "ui/base/window_open_disposition.h" |
| 32 #include "ui/gfx/rect.h" | 32 #include "ui/gfx/rect.h" |
| 33 | 33 |
| 34 #if defined(OS_WIN) | 34 #if defined(OS_WIN) |
| 35 #include "win8/util/win8_util.h" | 35 #include "win8/util/win8_util.h" |
| 36 #endif | 36 #endif |
| 37 | 37 |
| 38 using content::WebContents; | 38 using content::WebContents; |
| 39 using extensions::Extension; | 39 using extensions::Extension; |
| 40 using extensions::ExtensionPrefs; | 40 using extensions::ExtensionPrefs; |
| 41 | 41 |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 container = service->extension_prefs()->GetLaunchContainer( | 263 container = service->extension_prefs()->GetLaunchContainer( |
| 264 extension, extensions::ExtensionPrefs::LAUNCH_REGULAR); | 264 extension, extensions::ExtensionPrefs::LAUNCH_REGULAR); |
| 265 } | 265 } |
| 266 | 266 |
| 267 LaunchParams::LaunchParams(Profile* profile, | 267 LaunchParams::LaunchParams(Profile* profile, |
| 268 const extensions::Extension* extension, | 268 const extensions::Extension* extension, |
| 269 int event_flags) | 269 int event_flags) |
| 270 : profile(profile), | 270 : profile(profile), |
| 271 extension(extension), | 271 extension(extension), |
| 272 container(extension_misc::LAUNCH_NONE), | 272 container(extension_misc::LAUNCH_NONE), |
| 273 disposition(chrome::DispositionFromEventFlags(event_flags)), | 273 disposition(ui::DispositionFromEventFlags(event_flags)), |
| 274 override_url(), | 274 override_url(), |
| 275 command_line(NULL) { | 275 command_line(NULL) { |
| 276 if (disposition == NEW_FOREGROUND_TAB || disposition == NEW_BACKGROUND_TAB) { | 276 if (disposition == NEW_FOREGROUND_TAB || disposition == NEW_BACKGROUND_TAB) { |
| 277 container = extension_misc::LAUNCH_TAB; | 277 container = extension_misc::LAUNCH_TAB; |
| 278 } else if (disposition == NEW_WINDOW) { | 278 } else if (disposition == NEW_WINDOW) { |
| 279 container = extension_misc::LAUNCH_WINDOW; | 279 container = extension_misc::LAUNCH_WINDOW; |
| 280 } else { | 280 } else { |
| 281 ExtensionService* service = | 281 ExtensionService* service = |
| 282 extensions::ExtensionSystem::Get(profile)->extension_service(); | 282 extensions::ExtensionSystem::Get(profile)->extension_service(); |
| 283 DCHECK(service); | 283 DCHECK(service); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 // OnDidGetApplicationInfo, which calls | 352 // OnDidGetApplicationInfo, which calls |
| 353 // web_app::UpdateShortcutForTabContents when it sees UPDATE_SHORTCUT as | 353 // web_app::UpdateShortcutForTabContents when it sees UPDATE_SHORTCUT as |
| 354 // pending web app action. | 354 // pending web app action. |
| 355 extensions::TabHelper::FromWebContents(tab)->set_pending_web_app_action( | 355 extensions::TabHelper::FromWebContents(tab)->set_pending_web_app_action( |
| 356 extensions::TabHelper::UPDATE_SHORTCUT); | 356 extensions::TabHelper::UPDATE_SHORTCUT); |
| 357 | 357 |
| 358 return tab; | 358 return tab; |
| 359 } | 359 } |
| 360 | 360 |
| 361 } // namespace application_launch | 361 } // namespace application_launch |
| OLD | NEW |