| 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_function_dispatcher.h" | 5 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/json_reader.h" | 7 #include "base/json_reader.h" |
| 8 #include "base/json_writer.h" | 8 #include "base/json_writer.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 FactoryRegistry* FactoryRegistry::instance() { | 46 FactoryRegistry* FactoryRegistry::instance() { |
| 47 return Singleton<FactoryRegistry>::get(); | 47 return Singleton<FactoryRegistry>::get(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 FactoryRegistry::FactoryRegistry() { | 50 FactoryRegistry::FactoryRegistry() { |
| 51 // Register all functions here. | 51 // Register all functions here. |
| 52 | 52 |
| 53 // Tabs | 53 // Tabs |
| 54 factories_["GetWindows"] = &NewExtensionFunction<GetWindowsFunction>; | 54 factories_["GetWindows"] = &NewExtensionFunction<GetWindowsFunction>; |
| 55 factories_["CreateWindow"] = &NewExtensionFunction<CreateWindowFunction>; | 55 factories_["CreateWindow"] = &NewExtensionFunction<CreateWindowFunction>; |
| 56 factories_["RemoveWindow"] = &NewExtensionFunction<RemoveWindowFunction>; |
| 56 factories_["GetTabsForWindow"] = | 57 factories_["GetTabsForWindow"] = |
| 57 &NewExtensionFunction<GetTabsForWindowFunction>; | 58 &NewExtensionFunction<GetTabsForWindowFunction>; |
| 58 factories_["GetTab"] = &NewExtensionFunction<GetTabFunction>; | 59 factories_["GetTab"] = &NewExtensionFunction<GetTabFunction>; |
| 59 factories_["CreateTab"] = &NewExtensionFunction<CreateTabFunction>; | 60 factories_["CreateTab"] = &NewExtensionFunction<CreateTabFunction>; |
| 60 factories_["UpdateTab"] = &NewExtensionFunction<UpdateTabFunction>; | 61 factories_["UpdateTab"] = &NewExtensionFunction<UpdateTabFunction>; |
| 61 factories_["MoveTab"] = &NewExtensionFunction<MoveTabFunction>; | 62 factories_["MoveTab"] = &NewExtensionFunction<MoveTabFunction>; |
| 62 factories_["RemoveTab"] = &NewExtensionFunction<RemoveTabFunction>; | 63 factories_["RemoveTab"] = &NewExtensionFunction<RemoveTabFunction>; |
| 63 | 64 |
| 64 // Bookmarks | 65 // Bookmarks |
| 65 factories_["GetBookmarks"] = &NewExtensionFunction<GetBookmarksFunction>; | 66 factories_["GetBookmarks"] = &NewExtensionFunction<GetBookmarksFunction>; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 } else { | 155 } else { |
| 155 NOTREACHED(); | 156 NOTREACHED(); |
| 156 base::KillProcess(render_view_host_->process()->process().handle(), | 157 base::KillProcess(render_view_host_->process()->process().handle(), |
| 157 ResultCodes::KILLED_BAD_MESSAGE, false); | 158 ResultCodes::KILLED_BAD_MESSAGE, false); |
| 158 } | 159 } |
| 159 } | 160 } |
| 160 | 161 |
| 161 Profile* ExtensionFunctionDispatcher::profile() { | 162 Profile* ExtensionFunctionDispatcher::profile() { |
| 162 return render_view_host_->process()->profile(); | 163 return render_view_host_->process()->profile(); |
| 163 } | 164 } |
| OLD | NEW |