OLD | NEW |
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 CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_HANDLER_H_ |
6 #define CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_HANDLER_H_ | 6 #define CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_HANDLER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "content/public/browser/web_ui_message_handler.h" | 10 #include "content/public/browser/web_ui_message_handler.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 class ListValue; | 13 class ListValue; |
14 } | 14 } |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 class MediaInternalsProxy; | 17 class MediaInternalsProxy; |
18 | 18 |
19 // This class handles messages to and from MediaInternalsUI. | 19 // This class handles messages to and from MediaInternalsUI. |
20 // It does all its work on the IO thread through the proxy below. | 20 // It does all its work on the IO thread through the proxy below. |
21 class MediaInternalsMessageHandler : public WebUIMessageHandler { | 21 class MediaInternalsMessageHandler : public WebUIMessageHandler { |
22 public: | 22 public: |
23 MediaInternalsMessageHandler(); | 23 MediaInternalsMessageHandler(); |
24 virtual ~MediaInternalsMessageHandler(); | 24 virtual ~MediaInternalsMessageHandler(); |
25 | 25 |
26 // WebUIMessageHandler implementation. | 26 // WebUIMessageHandler implementation. |
27 virtual void RegisterMessages() OVERRIDE; | 27 virtual void RegisterMessages() override; |
28 | 28 |
29 // Javascript message handlers. | 29 // Javascript message handlers. |
30 void OnGetEverything(const base::ListValue* list); | 30 void OnGetEverything(const base::ListValue* list); |
31 | 31 |
32 // MediaInternals message handlers. | 32 // MediaInternals message handlers. |
33 void OnUpdate(const base::string16& update); | 33 void OnUpdate(const base::string16& update); |
34 | 34 |
35 private: | 35 private: |
36 scoped_refptr<MediaInternalsProxy> proxy_; | 36 scoped_refptr<MediaInternalsProxy> proxy_; |
37 | 37 |
38 // Reflects whether the chrome://media-internals HTML+JS has finished loading. | 38 // Reflects whether the chrome://media-internals HTML+JS has finished loading. |
39 // If not, it's not safe to send JavaScript calls targeting the page yet. | 39 // If not, it's not safe to send JavaScript calls targeting the page yet. |
40 bool page_load_complete_; | 40 bool page_load_complete_; |
41 | 41 |
42 DISALLOW_COPY_AND_ASSIGN(MediaInternalsMessageHandler); | 42 DISALLOW_COPY_AND_ASSIGN(MediaInternalsMessageHandler); |
43 }; | 43 }; |
44 | 44 |
45 } // namespace content | 45 } // namespace content |
46 | 46 |
47 #endif // CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_HANDLER_H_ | 47 #endif // CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_HANDLER_H_ |
OLD | NEW |