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

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

Issue 10332071: Pass command line arguments onto platform apps which provide the right intent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Doh Created 8 years, 7 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/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
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/lifetime/application_lifetime.h" 68 #include "chrome/browser/lifetime/application_lifetime.h"
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 browser->AddSelectedTabWithURL(url, content::PAGE_TRANSITION_LINK); 689 browser->AddSelectedTabWithURL(url, content::PAGE_TRANSITION_LINK);
690 browser->window()->Show(); 690 browser->window()->Show();
691 } 691 }
692 692
693 // static 693 // static
694 WebContents* Browser::OpenApplication( 694 WebContents* Browser::OpenApplication(
695 Profile* profile, 695 Profile* profile,
696 const Extension* extension, 696 const Extension* extension,
697 extension_misc::LaunchContainer container, 697 extension_misc::LaunchContainer container,
698 const GURL& override_url, 698 const GURL& override_url,
699 WindowOpenDisposition disposition) { 699 WindowOpenDisposition disposition,
700 const CommandLine* command_line) {
700 WebContents* tab = NULL; 701 WebContents* tab = NULL;
701 ExtensionPrefs* prefs = profile->GetExtensionService()->extension_prefs(); 702 ExtensionPrefs* prefs = profile->GetExtensionService()->extension_prefs();
702 prefs->SetActiveBit(extension->id(), true); 703 prefs->SetActiveBit(extension->id(), true);
703 704
704 UMA_HISTOGRAM_ENUMERATION("Extensions.AppLaunchContainer", container, 100); 705 UMA_HISTOGRAM_ENUMERATION("Extensions.AppLaunchContainer", container, 100);
705 706
706 if (extension->is_platform_app()) { 707 if (extension->is_platform_app()) {
707 extensions::AppEventRouter::DispatchOnLaunchedEvent(profile, extension); 708 extensions::LaunchPlatformApp(profile, extension, command_line);
708 return NULL; 709 return NULL;
709 } 710 }
710 711
711 switch (container) { 712 switch (container) {
712 case extension_misc::LAUNCH_NONE: { 713 case extension_misc::LAUNCH_NONE: {
713 NOTREACHED(); 714 NOTREACHED();
714 break; 715 break;
715 } 716 }
716 case extension_misc::LAUNCH_PANEL: 717 case extension_misc::LAUNCH_PANEL:
717 #if defined(USE_ASH) 718 #if defined(USE_ASH)
(...skipping 4707 matching lines...) Expand 10 before | Expand all | Expand 10 after
5425 if (contents && !allow_js_access) { 5426 if (contents && !allow_js_access) {
5426 contents->web_contents()->GetController().LoadURL( 5427 contents->web_contents()->GetController().LoadURL(
5427 target_url, 5428 target_url,
5428 content::Referrer(), 5429 content::Referrer(),
5429 content::PAGE_TRANSITION_LINK, 5430 content::PAGE_TRANSITION_LINK,
5430 std::string()); // No extra headers. 5431 std::string()); // No extra headers.
5431 } 5432 }
5432 5433
5433 return contents != NULL; 5434 return contents != NULL;
5434 } 5435 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698