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

Side by Side Diff: chrome/browser/ui/webui/media/media_internals_handler.cc

Issue 7554008: Removal of Profile from content part 6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Profile helper function, rebase Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/history_ui.cc ('k') | chrome/browser/ui/webui/net_internals_ui.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser/ui/webui/media/media_internals_handler.h" 5 #include "chrome/browser/ui/webui/media/media_internals_handler.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/ui/webui/media/media_internals_proxy.h" 9 #include "chrome/browser/ui/webui/media/media_internals_proxy.h"
10 #include "content/browser/browser_thread.h" 10 #include "content/browser/browser_thread.h"
11 #include "content/browser/renderer_host/render_view_host.h" 11 #include "content/browser/renderer_host/render_view_host.h"
12 #include "content/browser/tab_contents/tab_contents.h"
12 13
13 MediaInternalsMessageHandler::MediaInternalsMessageHandler() 14 MediaInternalsMessageHandler::MediaInternalsMessageHandler()
14 : proxy_(new MediaInternalsProxy()) {} 15 : proxy_(new MediaInternalsProxy()) {}
15 16
16 MediaInternalsMessageHandler::~MediaInternalsMessageHandler() { 17 MediaInternalsMessageHandler::~MediaInternalsMessageHandler() {
17 proxy_->Detach(); 18 proxy_->Detach();
18 } 19 }
19 20
20 WebUIMessageHandler* MediaInternalsMessageHandler::Attach(WebUI* web_ui) { 21 WebUIMessageHandler* MediaInternalsMessageHandler::Attach(WebUI* web_ui) {
21 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 22 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
22 WebUIMessageHandler* result = WebUIMessageHandler::Attach(web_ui); 23 WebUIMessageHandler* result = WebUIMessageHandler::Attach(web_ui);
23 proxy_->Attach(this); 24 proxy_->Attach(this);
24 return result; 25 return result;
25 } 26 }
26 27
27 void MediaInternalsMessageHandler::RegisterMessages() { 28 void MediaInternalsMessageHandler::RegisterMessages() {
28 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 29 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
29 30
30 web_ui_->RegisterMessageCallback( 31 web_ui_->RegisterMessageCallback(
31 "getEverything", 32 "getEverything",
32 NewCallback(this, &MediaInternalsMessageHandler::OnGetEverything)); 33 NewCallback(this, &MediaInternalsMessageHandler::OnGetEverything));
33 } 34 }
34 35
35 void MediaInternalsMessageHandler::OnGetEverything(const ListValue* list) { 36 void MediaInternalsMessageHandler::OnGetEverything(const ListValue* list) {
36 proxy_->GetEverything(); 37 proxy_->GetEverything();
37 } 38 }
38 39
39 void MediaInternalsMessageHandler::OnUpdate(const string16& update) { 40 void MediaInternalsMessageHandler::OnUpdate(const string16& update) {
40 web_ui_->GetRenderViewHost()->ExecuteJavascriptInWebFrame(string16(), update); 41 web_ui_->tab_contents()->render_view_host()->
42 ExecuteJavascriptInWebFrame(string16(), update);
41 } 43 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/history_ui.cc ('k') | chrome/browser/ui/webui/net_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698