| 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/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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 return false; | 333 return false; |
| 334 } | 334 } |
| 335 | 335 |
| 336 // Look at prefs to find the right launch container. | 336 // Look at prefs to find the right launch container. |
| 337 // |default_pref_value| is set to LAUNCH_REGULAR so that if | 337 // |default_pref_value| is set to LAUNCH_REGULAR so that if |
| 338 // the user has not set a preference, we open the app in a tab. | 338 // the user has not set a preference, we open the app in a tab. |
| 339 extension_misc::LaunchContainer launch_container = | 339 extension_misc::LaunchContainer launch_container = |
| 340 service()->extension_prefs()->GetLaunchContainer( | 340 service()->extension_prefs()->GetLaunchContainer( |
| 341 extension, ExtensionPrefs::LAUNCH_DEFAULT); | 341 extension, ExtensionPrefs::LAUNCH_DEFAULT); |
| 342 Browser::OpenApplication(profile(), extension, launch_container, GURL(), | 342 Browser::OpenApplication(profile(), extension, launch_container, GURL(), |
| 343 NEW_FOREGROUND_TAB); | 343 NEW_FOREGROUND_TAB, NULL); |
| 344 #if !defined(OS_ANDROID) | 344 #if !defined(OS_ANDROID) |
| 345 AppLauncherHandler::RecordAppLaunchType( | 345 AppLauncherHandler::RecordAppLaunchType( |
| 346 extension_misc::APP_LAUNCH_EXTENSION_API); | 346 extension_misc::APP_LAUNCH_EXTENSION_API); |
| 347 #endif | 347 #endif |
| 348 | 348 |
| 349 return true; | 349 return true; |
| 350 } | 350 } |
| 351 | 351 |
| 352 SetEnabledFunction::SetEnabledFunction() {} | 352 SetEnabledFunction::SetEnabledFunction() {} |
| 353 | 353 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 ExtensionService* service = profile->GetExtensionService(); | 497 ExtensionService* service = profile->GetExtensionService(); |
| 498 args.Append(CreateExtensionInfo(*extension, service)); | 498 args.Append(CreateExtensionInfo(*extension, service)); |
| 499 } | 499 } |
| 500 | 500 |
| 501 std::string args_json; | 501 std::string args_json; |
| 502 base::JSONWriter::Write(&args, &args_json); | 502 base::JSONWriter::Write(&args, &args_json); |
| 503 | 503 |
| 504 profile->GetExtensionEventRouter()->DispatchEventToRenderers( | 504 profile->GetExtensionEventRouter()->DispatchEventToRenderers( |
| 505 event_name, args_json, NULL, GURL()); | 505 event_name, args_json, NULL, GURL()); |
| 506 } | 506 } |
| OLD | NEW |