| 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 30 matching lines...) Expand all Loading... |
| 41 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg
ate.h" | 41 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg
ate.h" |
| 42 #include "chrome/browser/debugger/devtools_toggle_action.h" | 42 #include "chrome/browser/debugger/devtools_toggle_action.h" |
| 43 #include "chrome/browser/debugger/devtools_window.h" | 43 #include "chrome/browser/debugger/devtools_window.h" |
| 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/api/app/app_api.h" | |
| 52 #include "chrome/browser/extensions/browser_extension_window_controller.h" | 51 #include "chrome/browser/extensions/browser_extension_window_controller.h" |
| 53 #include "chrome/browser/extensions/crx_installer.h" | 52 #include "chrome/browser/extensions/crx_installer.h" |
| 54 #include "chrome/browser/extensions/default_apps_trial.h" | 53 #include "chrome/browser/extensions/default_apps_trial.h" |
| 55 #include "chrome/browser/extensions/extension_prefs.h" | 54 #include "chrome/browser/extensions/extension_prefs.h" |
| 56 #include "chrome/browser/extensions/extension_service.h" | 55 #include "chrome/browser/extensions/extension_service.h" |
| 57 #include "chrome/browser/extensions/extension_tab_helper.h" | 56 #include "chrome/browser/extensions/extension_tab_helper.h" |
| 58 #include "chrome/browser/extensions/extension_tabs_module.h" | 57 #include "chrome/browser/extensions/extension_tabs_module.h" |
| 58 #include "chrome/browser/extensions/platform_app_launcher.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" |
| 65 #include "chrome/browser/instant/instant_unload_handler.h" | 65 #include "chrome/browser/instant/instant_unload_handler.h" |
| 66 #include "chrome/browser/intents/register_intent_handler_infobar_delegate.h" | 66 #include "chrome/browser/intents/register_intent_handler_infobar_delegate.h" |
| 67 #include "chrome/browser/intents/web_intents_util.h" | 67 #include "chrome/browser/intents/web_intents_util.h" |
| 68 #include "chrome/browser/net/url_fixer_upper.h" | 68 #include "chrome/browser/net/url_fixer_upper.h" |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 browser->AddSelectedTabWithURL(url, content::PAGE_TRANSITION_LINK); | 686 browser->AddSelectedTabWithURL(url, content::PAGE_TRANSITION_LINK); |
| 687 browser->window()->Show(); | 687 browser->window()->Show(); |
| 688 } | 688 } |
| 689 | 689 |
| 690 // static | 690 // static |
| 691 WebContents* Browser::OpenApplication( | 691 WebContents* Browser::OpenApplication( |
| 692 Profile* profile, | 692 Profile* profile, |
| 693 const Extension* extension, | 693 const Extension* extension, |
| 694 extension_misc::LaunchContainer container, | 694 extension_misc::LaunchContainer container, |
| 695 const GURL& override_url, | 695 const GURL& override_url, |
| 696 WindowOpenDisposition disposition) { | 696 WindowOpenDisposition disposition, |
| 697 const CommandLine* command_line) { |
| 697 WebContents* tab = NULL; | 698 WebContents* tab = NULL; |
| 698 ExtensionPrefs* prefs = profile->GetExtensionService()->extension_prefs(); | 699 ExtensionPrefs* prefs = profile->GetExtensionService()->extension_prefs(); |
| 699 prefs->SetActiveBit(extension->id(), true); | 700 prefs->SetActiveBit(extension->id(), true); |
| 700 | 701 |
| 701 UMA_HISTOGRAM_ENUMERATION("Extensions.AppLaunchContainer", container, 100); | 702 UMA_HISTOGRAM_ENUMERATION("Extensions.AppLaunchContainer", container, 100); |
| 702 | 703 |
| 703 if (extension->is_platform_app()) { | 704 if (extension->is_platform_app()) { |
| 704 extensions::AppEventRouter::DispatchOnLaunchedEvent(profile, extension); | 705 extensions::LaunchPlatformApp(command_line, profile, extension); |
| 705 return NULL; | 706 return NULL; |
| 706 } | 707 } |
| 707 | 708 |
| 708 switch (container) { | 709 switch (container) { |
| 709 case extension_misc::LAUNCH_NONE: { | 710 case extension_misc::LAUNCH_NONE: { |
| 710 NOTREACHED(); | 711 NOTREACHED(); |
| 711 break; | 712 break; |
| 712 } | 713 } |
| 713 case extension_misc::LAUNCH_PANEL: | 714 case extension_misc::LAUNCH_PANEL: |
| 714 #if defined(USE_ASH) | 715 #if defined(USE_ASH) |
| (...skipping 4761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5476 if (contents && !allow_js_access) { | 5477 if (contents && !allow_js_access) { |
| 5477 contents->web_contents()->GetController().LoadURL( | 5478 contents->web_contents()->GetController().LoadURL( |
| 5478 target_url, | 5479 target_url, |
| 5479 content::Referrer(), | 5480 content::Referrer(), |
| 5480 content::PAGE_TRANSITION_LINK, | 5481 content::PAGE_TRANSITION_LINK, |
| 5481 std::string()); // No extra headers. | 5482 std::string()); // No extra headers. |
| 5482 } | 5483 } |
| 5483 | 5484 |
| 5484 return contents != NULL; | 5485 return contents != NULL; |
| 5485 } | 5486 } |
| OLD | NEW |