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

Side by Side Diff: chrome/test/render_view_test.cc

Issue 164039: Add module-level permissions to extensions. (Closed)
Patch Set: final nits Created 11 years, 4 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 | « chrome/test/data/extensions/uitest/simple_api_call/manifest.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/test/render_view_test.h" 5 #include "chrome/test/render_view_test.h"
6 6
7 #include "chrome/browser/extensions/extension_function_dispatcher.h" 7 #include "chrome/browser/extensions/extension_function_dispatcher.h"
8 #include "chrome/common/extensions/extension.h"
8 #include "chrome/common/native_web_keyboard_event.h" 9 #include "chrome/common/native_web_keyboard_event.h"
9 #include "chrome/common/render_messages.h" 10 #include "chrome/common/render_messages.h"
10 #include "chrome/common/renderer_preferences.h" 11 #include "chrome/common/renderer_preferences.h"
11 #include "chrome/renderer/extensions/event_bindings.h" 12 #include "chrome/renderer/extensions/event_bindings.h"
12 #include "chrome/renderer/extensions/extension_process_bindings.h" 13 #include "chrome/renderer/extensions/extension_process_bindings.h"
13 #include "chrome/renderer/extensions/renderer_extension_bindings.h" 14 #include "chrome/renderer/extensions/renderer_extension_bindings.h"
14 #include "chrome/renderer/js_only_v8_extensions.h" 15 #include "chrome/renderer/js_only_v8_extensions.h"
15 #include "chrome/renderer/renderer_main_platform_delegate.h" 16 #include "chrome/renderer/renderer_main_platform_delegate.h"
16 #include "webkit/api/public/WebInputEvent.h" 17 #include "webkit/api/public/WebInputEvent.h"
17 #include "webkit/api/public/WebKit.h" 18 #include "webkit/api/public/WebKit.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 WebKit::registerExtension(EventBindings::Get()); 74 WebKit::registerExtension(EventBindings::Get());
74 WebKit::registerExtension(ExtensionProcessBindings::Get()); 75 WebKit::registerExtension(ExtensionProcessBindings::Get());
75 WebKit::registerExtension(RendererExtensionBindings::Get()); 76 WebKit::registerExtension(RendererExtensionBindings::Get());
76 EventBindings::SetRenderThread(&render_thread_); 77 EventBindings::SetRenderThread(&render_thread_);
77 78
78 // TODO(aa): Should some of this go to some other inheriting class? 79 // TODO(aa): Should some of this go to some other inheriting class?
79 std::vector<std::string> names; 80 std::vector<std::string> names;
80 ExtensionFunctionDispatcher::GetAllFunctionNames(&names); 81 ExtensionFunctionDispatcher::GetAllFunctionNames(&names);
81 ExtensionProcessBindings::SetFunctionNames(names); 82 ExtensionProcessBindings::SetFunctionNames(names);
82 83
84 std::vector<std::string> permissions(
85 Extension::kPermissionNames,
86 Extension::kPermissionNames + Extension::kNumPermissions);
87 ExtensionProcessBindings::SetPermissions("", permissions);
88
83 mock_process_.reset(new MockProcess()); 89 mock_process_.reset(new MockProcess());
84 90
85 render_thread_.set_routing_id(kRouteId); 91 render_thread_.set_routing_id(kRouteId);
86 92
87 // This needs to pass the mock render thread to the view. 93 // This needs to pass the mock render thread to the view.
88 view_ = RenderView::Create(&render_thread_, NULL, NULL, kOpenerId, 94 view_ = RenderView::Create(&render_thread_, NULL, NULL, kOpenerId,
89 RendererPreferences(), WebPreferences(), 95 RendererPreferences(), WebPreferences(),
90 new SharedRenderViewCounter(0), kRouteId); 96 new SharedRenderViewCounter(0), kRouteId);
91 97
92 // Attach a pseudo keyboard device to this object. 98 // Attach a pseudo keyboard device to this object.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 keyup_message->WriteData(reinterpret_cast<const char*>(&keyup_event), 161 keyup_message->WriteData(reinterpret_cast<const char*>(&keyup_event),
156 sizeof(WebKit::WebKeyboardEvent)); 162 sizeof(WebKit::WebKeyboardEvent));
157 view_->OnHandleInputEvent(*keyup_message); 163 view_->OnHandleInputEvent(*keyup_message);
158 164
159 return length; 165 return length;
160 #else 166 #else
161 NOTIMPLEMENTED(); 167 NOTIMPLEMENTED();
162 return L'\0'; 168 return L'\0';
163 #endif 169 #endif
164 } 170 }
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/uitest/simple_api_call/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698