Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Side by Side Diff: extensions/renderer/dispatcher.h

Issue 399363002: Add support for writing unit tests for Mojo-backed apps/extensions APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/renderer/api_test_base_unittest.cc ('k') | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef EXTENSIONS_RENDERER_DISPATCHER_H_ 5 #ifndef EXTENSIONS_RENDERER_DISPATCHER_H_
6 #define EXTENSIONS_RENDERER_DISPATCHER_H_ 6 #define EXTENSIONS_RENDERER_DISPATCHER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 #include <utility>
11 #include <vector> 12 #include <vector>
12 13
13 #include "base/scoped_observer.h" 14 #include "base/scoped_observer.h"
14 #include "base/timer/timer.h" 15 #include "base/timer/timer.h"
15 #include "content/public/renderer/render_process_observer.h" 16 #include "content/public/renderer/render_process_observer.h"
16 #include "extensions/common/event_filter.h" 17 #include "extensions/common/event_filter.h"
17 #include "extensions/common/extension_set.h" 18 #include "extensions/common/extension_set.h"
18 #include "extensions/common/extensions_client.h" 19 #include "extensions/common/extensions_client.h"
19 #include "extensions/common/features/feature.h" 20 #include "extensions/common/features/feature.h"
20 #include "extensions/renderer/resource_bundle_source_map.h" 21 #include "extensions/renderer/resource_bundle_source_map.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // Shared implementation of the various MessageInvoke IPCs. 130 // Shared implementation of the various MessageInvoke IPCs.
130 void InvokeModuleSystemMethod(content::RenderView* render_view, 131 void InvokeModuleSystemMethod(content::RenderView* render_view,
131 const std::string& extension_id, 132 const std::string& extension_id,
132 const std::string& module_name, 133 const std::string& module_name,
133 const std::string& function_name, 134 const std::string& function_name,
134 const base::ListValue& args, 135 const base::ListValue& args,
135 bool user_gesture); 136 bool user_gesture);
136 137
137 void ClearPortData(int port_id); 138 void ClearPortData(int port_id);
138 139
140 // Returns a list of (module name, resource id) pairs for the JS modules to
141 // add to the source map.
142 static std::vector<std::pair<std::string, int> > GetJsResources();
143 static void RegisterNativeHandlers(ModuleSystem* module_system,
144 ScriptContext* context,
145 Dispatcher* dispatcher,
146 RequestSender* request_sender,
147 V8SchemaRegistry* v8_schema_registry);
148
139 private: 149 private:
140 friend class ::ChromeRenderViewTest; 150 friend class ::ChromeRenderViewTest;
141 FRIEND_TEST_ALL_PREFIXES(RendererPermissionsPolicyDelegateTest, 151 FRIEND_TEST_ALL_PREFIXES(RendererPermissionsPolicyDelegateTest,
142 CannotScriptWebstore); 152 CannotScriptWebstore);
143 153
144 // RenderProcessObserver implementation: 154 // RenderProcessObserver implementation:
145 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; 155 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
146 virtual void WebKitInitialized() OVERRIDE; 156 virtual void WebKitInitialized() OVERRIDE;
147 virtual void IdleNotification() OVERRIDE; 157 virtual void IdleNotification() OVERRIDE;
148 virtual void OnRenderProcessShutdown() OVERRIDE; 158 virtual void OnRenderProcessShutdown() OVERRIDE;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 // the observer is destroyed before the UserScriptSet. 308 // the observer is destroyed before the UserScriptSet.
299 ScopedObserver<UserScriptSet, UserScriptSet::Observer> 309 ScopedObserver<UserScriptSet, UserScriptSet::Observer>
300 user_script_set_observer_; 310 user_script_set_observer_;
301 311
302 DISALLOW_COPY_AND_ASSIGN(Dispatcher); 312 DISALLOW_COPY_AND_ASSIGN(Dispatcher);
303 }; 313 };
304 314
305 } // namespace extensions 315 } // namespace extensions
306 316
307 #endif // EXTENSIONS_RENDERER_DISPATCHER_H_ 317 #endif // EXTENSIONS_RENDERER_DISPATCHER_H_
OLDNEW
« no previous file with comments | « extensions/renderer/api_test_base_unittest.cc ('k') | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698