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

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: Moving MediaInternalsProxy to its own file. 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..7c6375a7d801a0db431d9dafb026cfd5b5225e93 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()) {
scherkus (not reviewing) 2011/06/29 17:55:12 re: pass in UI in ctor, you'll probably have to us
contents->profile()->GetChromeURLDataManager()->AddDataSource(
new MediaInternalsHTMLSource());
+ proxy_->SetUI(this);
+}
+
+MediaInternalsUI::~MediaInternalsUI() {
+ proxy_->RemoveUI();
}
+void MediaInternalsUI::OnWebUISend(const GURL& source_url,
+ 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