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

Side by Side Diff: content/renderer/web_ui_extension_data.cc

Issue 10873038: Replacing WebUIBindings use of CPPBoundClass with v8::Extension. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Ensure WebUIBinding variables are available in all frames. Created 8 years, 1 month 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/renderer/web_ui_extension_data.h"
6
7 #include "base/utf_string_conversions.h"
8 #include "content/common/view_messages.h"
9 #include "content/public/renderer/render_view.h"
10
11 namespace content {
12
13 WebUIExtensionData::WebUIExtensionData(RenderView* render_view)
14 : RenderViewObserver(render_view),
15 RenderViewObserverTracker<WebUIExtensionData>(render_view) {
16 }
17
18 WebUIExtensionData::~WebUIExtensionData() {
19 }
20
21 string16 WebUIExtensionData::GetValue(const string16& key) const {
22 std::map<string16, string16>::const_iterator it = variable_map_.find(key);
23 if (it == variable_map_.end())
24 return string16();
25 return it->second;
26 }
27
28 bool WebUIExtensionData::OnMessageReceived(const IPC::Message& message) {
29 bool handled = true;
30 IPC_BEGIN_MESSAGE_MAP(WebUIExtensionData, message)
31 IPC_MESSAGE_HANDLER(ViewMsg_SetWebUIProperty, OnSetWebUIProperty)
32 IPC_MESSAGE_UNHANDLED(handled = false)
33 IPC_END_MESSAGE_MAP()
34 return handled;
35 }
36
37 void WebUIExtensionData::OnSetWebUIProperty(const std::string& name,
38 const std::string& value) {
39 variable_map_[UTF8ToUTF16(name)] = UTF8ToUTF16(value);
40 }
41
42 } // namespace content
OLDNEW
« content/renderer/web_ui_extension_data.h ('K') | « content/renderer/web_ui_extension_data.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698