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

Side by Side Diff: chrome/browser/ui/webui/media_internals_ui.h

Issue 7272036: Make MediaInternalsUI talk to MediaInternals. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 5 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 | « no previous file | chrome/browser/ui/webui/media_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 #ifndef CHROME_BROWSER_UI_WEBUI_MEDIA_INTERNALS_UI_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_MEDIA_INTERNALS_UI_H_
6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_INTERNALS_UI_H_ 6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_INTERNALS_UI_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/ui/webui/chrome_web_ui.h" 9 #include "chrome/browser/ui/webui/chrome_web_ui.h"
10 10
scherkus (not reviewing) 2011/06/29 01:03:07 a/z ordering for includes
Scott Franklin 2011/06/29 17:35:23 Done.
11 #include "base/memory/ref_counted.h"
12 #include "chrome/browser/media/media_internals_observer.h"
13
14 class MediaInternalsUI;
scherkus (not reviewing) 2011/06/29 01:03:07 a/z ordering
Scott Franklin 2011/06/29 17:35:23 Done.
15 class IOThread;
16
17 class MediaInternalsProxy
18 : public MediaInternalsObserver,
19 public base::RefCountedThreadSafe<MediaInternalsProxy> {
20 public:
21 // Methods for MediaInternalsUI. Called on UI thread.
22 MediaInternalsProxy();
23 void SetUI(MediaInternalsUI* ui);
24 void RemoveUI();
25 void GetEverything();
26
27 // MediaInternalsObserver implementation. Called on IO thread.
28 virtual void OnUpdate(const string16& update);
29
30 private:
31 friend class base::RefCountedThreadSafe<MediaInternalsProxy>;
32 virtual ~MediaInternalsProxy();
33
34 void ObserveMediaInternalsOnIOThread();
35 void StopObservingMediaInternalsOnIOThread();
36 void GetEverythingOnIOThread();
37 void UpdateUIOnUIThread(const string16& update);
38
39 MediaInternalsUI* ui_;
40 IOThread* io_thread_;
41 };
42
11 // The implementation for the chrome://media-internals page. 43 // The implementation for the chrome://media-internals page.
12 class MediaInternalsUI : public ChromeWebUI { 44 class MediaInternalsUI : public ChromeWebUI {
13 public: 45 public:
14 explicit MediaInternalsUI(TabContents* contents); 46 explicit MediaInternalsUI(TabContents* contents);
47 virtual ~MediaInternalsUI();
48
49 virtual void OnWebUISend(const GURL& source_url,
50 const std::string& name,
51 const ListValue& args) OVERRIDE;
52
53 virtual void OnUpdate(const string16& update);
15 54
16 private: 55 private:
56 scoped_refptr<MediaInternalsProxy> proxy_;
57
17 DISALLOW_COPY_AND_ASSIGN(MediaInternalsUI); 58 DISALLOW_COPY_AND_ASSIGN(MediaInternalsUI);
18 }; 59 };
19 60
20 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_INTERNALS_UI_H_ 61 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_INTERNALS_UI_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/media_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698