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

Side by Side Diff: chrome/browser/ui/views/ash/extension_utils.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: Windows tests fixed 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/views/ash/extension_utils.h" 5 #include "chrome/browser/ui/views/ash/extension_utils.h"
6 6
7 #include "chrome/browser/event_disposition.h" 7 #include "chrome/browser/event_disposition.h"
8 #include "chrome/browser/extensions/extension_prefs.h" 8 #include "chrome/browser/extensions/extension_prefs.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 14 matching lines...) Expand all
25 WindowOpenDisposition disposition = 25 WindowOpenDisposition disposition =
26 browser::DispositionFromEventFlags(event_flags); 26 browser::DispositionFromEventFlags(event_flags);
27 27
28 GURL url; 28 GURL url;
29 if (extension->id() == extension_misc::kWebStoreAppId) 29 if (extension->id() == extension_misc::kWebStoreAppId)
30 url = extension->GetFullLaunchURL(); 30 url = extension->GetFullLaunchURL();
31 31
32 if (disposition == NEW_FOREGROUND_TAB || disposition == NEW_BACKGROUND_TAB) { 32 if (disposition == NEW_FOREGROUND_TAB || disposition == NEW_BACKGROUND_TAB) {
33 // Opens in a tab. 33 // Opens in a tab.
34 application_launch::OpenApplication( 34 application_launch::OpenApplication(
35 profile, extension, extension_misc::LAUNCH_TAB, url, disposition); 35 profile, extension, extension_misc::LAUNCH_TAB, url, disposition, NULL);
36 } else if (disposition == NEW_WINDOW) { 36 } else if (disposition == NEW_WINDOW) {
37 // Force a new window open. 37 // Force a new window open.
38 application_launch::OpenApplication( 38 application_launch::OpenApplication(
39 profile, extension, extension_misc::LAUNCH_WINDOW, url, 39 profile, extension, extension_misc::LAUNCH_WINDOW, url,
40 disposition); 40 disposition, NULL);
41 } else { 41 } else {
42 // Look at preference to find the right launch container. If no preference 42 // Look at preference to find the right launch container. If no preference
43 // is set, launch as a regular tab. 43 // is set, launch as a regular tab.
44 extension_misc::LaunchContainer launch_container = 44 extension_misc::LaunchContainer launch_container =
45 profile->GetExtensionService()->extension_prefs()->GetLaunchContainer( 45 profile->GetExtensionService()->extension_prefs()->GetLaunchContainer(
46 extension, ExtensionPrefs::LAUNCH_DEFAULT); 46 extension, ExtensionPrefs::LAUNCH_DEFAULT);
47 47
48 application_launch::OpenApplication( 48 application_launch::OpenApplication(
49 profile, extension, launch_container, GURL(url), 49 profile, extension, launch_container, GURL(url),
50 NEW_FOREGROUND_TAB); 50 NEW_FOREGROUND_TAB, NULL);
51 } 51 }
52 } 52 }
53 53
54 } // namespace extension_utils 54 } // namespace extension_utils
OLDNEW
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator_impl.cc ('k') | chrome/browser/ui/webui/ntp/app_launcher_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698