OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/automation/automation_provider_observers.h" | 5 #include "chrome/browser/automation/automation_provider_observers.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1972 // of the created vector. | 1972 // of the created vector. |
1973 std::vector<DictionaryValue*>* GetAppInfoFromExtensions( | 1973 std::vector<DictionaryValue*>* GetAppInfoFromExtensions( |
1974 const ExtensionList* extensions, | 1974 const ExtensionList* extensions, |
1975 ExtensionService* ext_service) { | 1975 ExtensionService* ext_service) { |
1976 std::vector<DictionaryValue*>* apps_list = | 1976 std::vector<DictionaryValue*>* apps_list = |
1977 new std::vector<DictionaryValue*>(); | 1977 new std::vector<DictionaryValue*>(); |
1978 for (ExtensionList::const_iterator ext = extensions->begin(); | 1978 for (ExtensionList::const_iterator ext = extensions->begin(); |
1979 ext != extensions->end(); ++ext) { | 1979 ext != extensions->end(); ++ext) { |
1980 // Only return information about extensions that are actually apps. | 1980 // Only return information about extensions that are actually apps. |
1981 if ((*ext)->is_app()) { | 1981 if ((*ext)->is_app()) { |
1982 DictionaryValue* app_info = new DictionaryValue(); | 1982 DictionaryValue* app_info = |
1983 AppLauncherHandler::CreateAppInfo(*ext, NULL, ext_service, app_info); | 1983 AppLauncherHandler::CreateAppInfo(*ext, NULL, ext_service); |
| 1984 if (!app_info) |
| 1985 continue; |
1984 app_info->SetBoolean("is_component_extension", | 1986 app_info->SetBoolean("is_component_extension", |
1985 (*ext)->location() == Extension::COMPONENT); | 1987 (*ext)->location() == Extension::COMPONENT); |
1986 | 1988 |
1987 // Convert the launch_type integer into a more descriptive string. | 1989 // Convert the launch_type integer into a more descriptive string. |
1988 int launch_type; | 1990 int launch_type; |
1989 const char* kLaunchType = "launch_type"; | 1991 const char* kLaunchType = "launch_type"; |
1990 if (!app_info->GetInteger(kLaunchType, &launch_type)) { | 1992 if (!app_info->GetInteger(kLaunchType, &launch_type)) { |
1991 NOTREACHED() << "Can't get integer from key " << kLaunchType; | 1993 NOTREACHED() << "Can't get integer from key " << kLaunchType; |
1992 continue; | 1994 continue; |
1993 } | 1995 } |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2648 void DragTargetDropAckNotificationObserver::Observe( | 2650 void DragTargetDropAckNotificationObserver::Observe( |
2649 int type, | 2651 int type, |
2650 const NotificationSource& source, | 2652 const NotificationSource& source, |
2651 const NotificationDetails& details) { | 2653 const NotificationDetails& details) { |
2652 if (automation_) { | 2654 if (automation_) { |
2653 AutomationJSONReply(automation_, | 2655 AutomationJSONReply(automation_, |
2654 reply_message_.release()).SendSuccess(NULL); | 2656 reply_message_.release()).SendSuccess(NULL); |
2655 } | 2657 } |
2656 delete this; | 2658 delete this; |
2657 } | 2659 } |
OLD | NEW |