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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 44 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
45 #include "chrome/browser/download/download_item_model.h" | 45 #include "chrome/browser/download/download_item_model.h" |
46 #include "chrome/browser/download/download_service.h" | 46 #include "chrome/browser/download/download_service.h" |
47 #include "chrome/browser/download/download_service_factory.h" | 47 #include "chrome/browser/download/download_service_factory.h" |
48 #include "chrome/browser/download/download_shelf.h" | 48 #include "chrome/browser/download/download_shelf.h" |
49 #include "chrome/browser/download/download_started_animation.h" | 49 #include "chrome/browser/download/download_started_animation.h" |
50 #include "chrome/browser/download/download_util.h" | 50 #include "chrome/browser/download/download_util.h" |
51 #include "chrome/browser/extensions/browser_extension_window_controller.h" | 51 #include "chrome/browser/extensions/browser_extension_window_controller.h" |
52 #include "chrome/browser/extensions/crx_installer.h" | 52 #include "chrome/browser/extensions/crx_installer.h" |
53 #include "chrome/browser/extensions/default_apps_trial.h" | 53 #include "chrome/browser/extensions/default_apps_trial.h" |
54 #include "chrome/browser/extensions/extension_browser_event_router.h" | 54 #include "chrome/browser/extensions/api/app/app_api.h" |
55 #include "chrome/browser/extensions/extension_prefs.h" | 55 #include "chrome/browser/extensions/extension_prefs.h" |
56 #include "chrome/browser/extensions/extension_service.h" | 56 #include "chrome/browser/extensions/extension_service.h" |
57 #include "chrome/browser/extensions/extension_tab_helper.h" | 57 #include "chrome/browser/extensions/extension_tab_helper.h" |
58 #include "chrome/browser/extensions/extension_tabs_module.h" | 58 #include "chrome/browser/extensions/extension_tabs_module.h" |
59 #include "chrome/browser/favicon/favicon_tab_helper.h" | 59 #include "chrome/browser/favicon/favicon_tab_helper.h" |
60 #include "chrome/browser/file_select_helper.h" | 60 #include "chrome/browser/file_select_helper.h" |
61 #include "chrome/browser/first_run/first_run.h" | 61 #include "chrome/browser/first_run/first_run.h" |
62 #include "chrome/browser/google/google_url_tracker.h" | 62 #include "chrome/browser/google/google_url_tracker.h" |
63 #include "chrome/browser/infobars/infobar_tab_helper.h" | 63 #include "chrome/browser/infobars/infobar_tab_helper.h" |
64 #include "chrome/browser/instant/instant_controller.h" | 64 #include "chrome/browser/instant/instant_controller.h" |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 const Extension* extension, | 685 const Extension* extension, |
686 extension_misc::LaunchContainer container, | 686 extension_misc::LaunchContainer container, |
687 const GURL& override_url, | 687 const GURL& override_url, |
688 WindowOpenDisposition disposition) { | 688 WindowOpenDisposition disposition) { |
689 WebContents* tab = NULL; | 689 WebContents* tab = NULL; |
690 ExtensionPrefs* prefs = profile->GetExtensionService()->extension_prefs(); | 690 ExtensionPrefs* prefs = profile->GetExtensionService()->extension_prefs(); |
691 prefs->SetActiveBit(extension->id(), true); | 691 prefs->SetActiveBit(extension->id(), true); |
692 | 692 |
693 UMA_HISTOGRAM_ENUMERATION("Extensions.AppLaunchContainer", container, 100); | 693 UMA_HISTOGRAM_ENUMERATION("Extensions.AppLaunchContainer", container, 100); |
694 | 694 |
| 695 if (extension->is_platform_app()) { |
| 696 extensions::AppEventRouter::DispatchOnLaunchedEvent(profile, extension); |
| 697 return NULL; |
| 698 } |
| 699 |
695 switch (container) { | 700 switch (container) { |
696 case extension_misc::LAUNCH_SHELL: { | 701 case extension_misc::LAUNCH_NONE: { |
697 ShellWindow* shell_window = ShellWindow::Create( | 702 NOTREACHED(); |
698 profile, | |
699 extension, | |
700 UrlForExtension(extension, override_url)); | |
701 if (shell_window) | |
702 tab = shell_window->web_contents(); | |
703 break; | 703 break; |
704 } | 704 } |
705 case extension_misc::LAUNCH_PANEL: | 705 case extension_misc::LAUNCH_PANEL: |
706 #if defined(USE_ASH) | 706 #if defined(USE_ASH) |
707 if (extension && | 707 if (extension && |
708 CommandLine::ForCurrentProcess()->HasSwitch( | 708 CommandLine::ForCurrentProcess()->HasSwitch( |
709 ash::switches::kAuraPanelManager)) { | 709 ash::switches::kAuraPanelManager)) { |
710 tab = OpenApplicationPanel(profile, extension, override_url); | 710 tab = OpenApplicationPanel(profile, extension, override_url); |
711 break; | 711 break; |
712 } | 712 } |
(...skipping 4783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5496 if (contents && !allow_js_access) { | 5496 if (contents && !allow_js_access) { |
5497 contents->web_contents()->GetController().LoadURL( | 5497 contents->web_contents()->GetController().LoadURL( |
5498 target_url, | 5498 target_url, |
5499 content::Referrer(), | 5499 content::Referrer(), |
5500 content::PAGE_TRANSITION_LINK, | 5500 content::PAGE_TRANSITION_LINK, |
5501 std::string()); // No extra headers. | 5501 std::string()); // No extra headers. |
5502 } | 5502 } |
5503 | 5503 |
5504 return contents != NULL; | 5504 return contents != NULL; |
5505 } | 5505 } |
OLD | NEW |