| 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/renderer/extensions/page_actions_custom_bindings.h" | 5 #include "chrome/renderer/extensions/page_actions_custom_bindings.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "chrome/common/extensions/api/extension_action/action_info.h" | 10 #include "chrome/common/extensions/api/extension_action/action_info.h" |
| 11 #include "chrome/common/extensions/extension.h" | |
| 12 #include "chrome/renderer/extensions/dispatcher.h" | 11 #include "chrome/renderer/extensions/dispatcher.h" |
| 12 #include "extensions/common/extension.h" |
| 13 #include "grit/renderer_resources.h" | 13 #include "grit/renderer_resources.h" |
| 14 #include "v8/include/v8.h" | 14 #include "v8/include/v8.h" |
| 15 | 15 |
| 16 namespace extensions { | 16 namespace extensions { |
| 17 | 17 |
| 18 PageActionsCustomBindings::PageActionsCustomBindings( | 18 PageActionsCustomBindings::PageActionsCustomBindings( |
| 19 Dispatcher* dispatcher, ChromeV8Context* context) | 19 Dispatcher* dispatcher, ChromeV8Context* context) |
| 20 : ChromeV8Extension(dispatcher, context) { | 20 : ChromeV8Extension(dispatcher, context) { |
| 21 RouteFunction("GetCurrentPageActions", | 21 RouteFunction("GetCurrentPageActions", |
| 22 base::Bind(&PageActionsCustomBindings::GetCurrentPageActions, | 22 base::Bind(&PageActionsCustomBindings::GetCurrentPageActions, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 35 if (ActionInfo::GetPageActionInfo(extension)) { | 35 if (ActionInfo::GetPageActionInfo(extension)) { |
| 36 std::string id = ActionInfo::GetPageActionInfo(extension)->id; | 36 std::string id = ActionInfo::GetPageActionInfo(extension)->id; |
| 37 page_action_vector->Set(v8::Integer::New(0), | 37 page_action_vector->Set(v8::Integer::New(0), |
| 38 v8::String::New(id.c_str(), id.size())); | 38 v8::String::New(id.c_str(), id.size())); |
| 39 } | 39 } |
| 40 | 40 |
| 41 args.GetReturnValue().Set(page_action_vector); | 41 args.GetReturnValue().Set(page_action_vector); |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace extensions | 44 } // namespace extensions |
| OLD | NEW |