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

Unified 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: Using typeof == "function" 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/web_ui_extension_data.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/web_ui_extension_data.cc
diff --git a/content/renderer/web_ui_extension_data.cc b/content/renderer/web_ui_extension_data.cc
new file mode 100644
index 0000000000000000000000000000000000000000..80d570fd9a13137d7e88333722f80a9399b40999
--- /dev/null
+++ b/content/renderer/web_ui_extension_data.cc
@@ -0,0 +1,42 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/renderer/web_ui_extension_data.h"
+
+#include "content/common/view_messages.h"
+#include "content/public/renderer/render_view.h"
+
+namespace content {
+
+WebUIExtensionData::WebUIExtensionData(RenderView* render_view)
+ : RenderViewObserver(render_view),
+ RenderViewObserverTracker<WebUIExtensionData>(render_view) {
+}
+
+WebUIExtensionData::~WebUIExtensionData() {
+}
+
+std::string WebUIExtensionData::GetValue(const std::string& key) const {
+ std::map<std::string, std::string>::const_iterator it =
+ variable_map_.find(key);
+ if (it == variable_map_.end())
+ return std::string();
+ return it->second;
+}
+
+bool WebUIExtensionData::OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(WebUIExtensionData, message)
+ IPC_MESSAGE_HANDLER(ViewMsg_SetWebUIProperty, OnSetWebUIProperty)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ return handled;
+}
+
+void WebUIExtensionData::OnSetWebUIProperty(const std::string& name,
+ const std::string& value) {
+ variable_map_[name] = value;
+}
+
+} // namespace content
« no previous file with comments | « 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