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

Side by Side Diff: chrome/browser/extensions/extension_management_api.cc

Issue 10700130: Introduce LaunchParams struct for opening chrome apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix bad merge Created 8 years, 5 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/extensions/extension_management_api.h" 5 #include "chrome/browser/extensions/extension_management_api.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 extension_id); 355 extension_id);
356 return false; 356 return false;
357 } 357 }
358 358
359 // Look at prefs to find the right launch container. 359 // Look at prefs to find the right launch container.
360 // |default_pref_value| is set to LAUNCH_REGULAR so that if 360 // |default_pref_value| is set to LAUNCH_REGULAR so that if
361 // the user has not set a preference, we open the app in a tab. 361 // the user has not set a preference, we open the app in a tab.
362 extension_misc::LaunchContainer launch_container = 362 extension_misc::LaunchContainer launch_container =
363 service()->extension_prefs()->GetLaunchContainer( 363 service()->extension_prefs()->GetLaunchContainer(
364 extension, extensions::ExtensionPrefs::LAUNCH_DEFAULT); 364 extension, extensions::ExtensionPrefs::LAUNCH_DEFAULT);
365 application_launch::OpenApplication(profile(), extension, launch_container, 365 application_launch::OpenApplication(application_launch::LaunchParams(
366 GURL(), NEW_FOREGROUND_TAB, NULL); 366 profile(), extension, launch_container, NEW_FOREGROUND_TAB));
367 #if !defined(OS_ANDROID) 367 #if !defined(OS_ANDROID)
368 AppLauncherHandler::RecordAppLaunchType( 368 AppLauncherHandler::RecordAppLaunchType(
369 extension_misc::APP_LAUNCH_EXTENSION_API); 369 extension_misc::APP_LAUNCH_EXTENSION_API);
370 #endif 370 #endif
371 371
372 return true; 372 return true;
373 } 373 }
374 374
375 SetEnabledFunction::SetEnabledFunction() { 375 SetEnabledFunction::SetEnabledFunction() {
376 } 376 }
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 ExtensionService* service = profile->GetExtensionService(); 585 ExtensionService* service = profile->GetExtensionService();
586 args.Append(CreateExtensionInfo(*extension, service)); 586 args.Append(CreateExtensionInfo(*extension, service));
587 } 587 }
588 588
589 std::string args_json; 589 std::string args_json;
590 base::JSONWriter::Write(&args, &args_json); 590 base::JSONWriter::Write(&args, &args_json);
591 591
592 profile->GetExtensionEventRouter()->DispatchEventToRenderers( 592 profile->GetExtensionEventRouter()->DispatchEventToRenderers(
593 event_name, args_json, NULL, GURL(), extensions::EventFilteringInfo()); 593 event_name, args_json, NULL, GURL(), extensions::EventFilteringInfo());
594 } 594 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_apitest.cc ('k') | chrome/browser/extensions/platform_app_browsertest_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698