| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_popup_api.h" | 5 #include "chrome/browser/extensions/extension_popup_api.h" |
| 6 | 6 |
| 7 #include "base/gfx/point.h" | 7 #include "base/gfx/point.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 NotificationService::AllSources()); | 66 NotificationService::AllSources()); |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 #else | 69 #else |
| 70 SendResponse(false); | 70 SendResponse(false); |
| 71 #endif | 71 #endif |
| 72 } | 72 } |
| 73 | 73 |
| 74 bool PopupShowFunction::RunImpl() { | 74 bool PopupShowFunction::RunImpl() { |
| 75 EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_LIST)); | 75 EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_LIST)); |
| 76 const ListValue* args = static_cast<const ListValue*>(args_); | 76 const ListValue* args = args_as_list(); |
| 77 | 77 |
| 78 DictionaryValue* popup_info = NULL; | 78 DictionaryValue* popup_info = NULL; |
| 79 EXTENSION_FUNCTION_VALIDATE(args->GetDictionary(0, &popup_info)); | 79 EXTENSION_FUNCTION_VALIDATE(args->GetDictionary(0, &popup_info)); |
| 80 | 80 |
| 81 std::string url_string; | 81 std::string url_string; |
| 82 EXTENSION_FUNCTION_VALIDATE(popup_info->GetString(kUrlKey, | 82 EXTENSION_FUNCTION_VALIDATE(popup_info->GetString(kUrlKey, |
| 83 &url_string)); | 83 &url_string)); |
| 84 | 84 |
| 85 DictionaryValue* dom_anchor = NULL; | 85 DictionaryValue* dom_anchor = NULL; |
| 86 EXTENSION_FUNCTION_VALIDATE(args->GetDictionary(1, &dom_anchor)); | 86 EXTENSION_FUNCTION_VALIDATE(args->GetDictionary(1, &dom_anchor)); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 void PopupEventRouter::OnPopupClosed(Profile* profile, | 155 void PopupEventRouter::OnPopupClosed(Profile* profile, |
| 156 int routing_id) { | 156 int routing_id) { |
| 157 std::string full_event_name = StringPrintf( | 157 std::string full_event_name = StringPrintf( |
| 158 extension_popup_module_events::kOnPopupClosed, | 158 extension_popup_module_events::kOnPopupClosed, |
| 159 routing_id); | 159 routing_id); |
| 160 | 160 |
| 161 profile->GetExtensionMessageService()->DispatchEventToRenderers( | 161 profile->GetExtensionMessageService()->DispatchEventToRenderers( |
| 162 full_event_name, | 162 full_event_name, |
| 163 base::JSONWriter::kEmptyArray); | 163 base::JSONWriter::kEmptyArray); |
| 164 } | 164 } |
| OLD | NEW |