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

Unified Diff: chrome/browser/ui/webui/media_internals_ui.cc

Issue 7272036: Make MediaInternalsUI talk to MediaInternals. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Responding to comments Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/media_internals_ui.cc
diff --git a/chrome/browser/ui/webui/media_internals_ui.cc b/chrome/browser/ui/webui/media_internals_ui.cc
index de2f4227113effe68db6fbd58a91fd8c1faac324..4373d8fe6b37baf0f703c167f74c03dd2c3cd484 100644
--- a/chrome/browser/ui/webui/media_internals_ui.cc
+++ b/chrome/browser/ui/webui/media_internals_ui.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
+#include "chrome/browser/ui/webui/media_internals_proxy.h"
#include "chrome/common/jstemplate_builder.h"
#include "chrome/common/url_constants.h"
#include "grit/browser_resources.h"
@@ -71,7 +72,6 @@ std::string MediaInternalsHTMLSource::GetMimeType(
} // namespace
-
////////////////////////////////////////////////////////////////////////////////
//
// MediaInternalsUI
@@ -79,8 +79,24 @@ std::string MediaInternalsHTMLSource::GetMimeType(
////////////////////////////////////////////////////////////////////////////////
MediaInternalsUI::MediaInternalsUI(TabContents* contents)
- : ChromeWebUI(contents) {
+ : ChromeWebUI(contents),
+ proxy_(new MediaInternalsProxy()) {
contents->profile()->GetChromeURLDataManager()->AddDataSource(
new MediaInternalsHTMLSource());
+ proxy_->AttachUI(this);
+}
+
+MediaInternalsUI::~MediaInternalsUI() {
+ proxy_->DetachUI();
}
+void MediaInternalsUI::OnWebUISend(const GURL& source_url,
Evan Stade 2011/06/29 20:13:01 what is this? I dont see docs for OnWebUISend anyw
Scott Franklin 2011/06/29 23:47:08 It's defined in content/browser/webui/webui.h. I p
+ const std::string& name,
+ const ListValue& content) {
+ if (name == "getAll")
+ proxy_->GetEverything();
+}
+
+void MediaInternalsUI::OnUpdate(const string16& update) {
+ ExecuteJavascript(update);
+}

Powered by Google App Engine
This is Rietveld 408576698