OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_PROXIMITY_AUTH_WEBUI_PROXIMITY_AUTH_WEBUI_HANDLER_H_ | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_WEBUI_PROXIMITY_AUTH_WEBUI_HANDLER_H_ |
6 #define COMPONENTS_PROXIMITY_AUTH_WEBUI_PROXIMITY_AUTH_WEBUI_HANDLER_H_ | 6 #define COMPONENTS_PROXIMITY_AUTH_WEBUI_PROXIMITY_AUTH_WEBUI_HANDLER_H_ |
7 | 7 |
| 8 #include "components/proximity_auth/logging/log_buffer.h" |
8 #include "content/public/browser/web_ui_message_handler.h" | 9 #include "content/public/browser/web_ui_message_handler.h" |
9 | 10 |
| 11 namespace base { |
| 12 class ListValue; |
| 13 } |
| 14 |
10 namespace proximity_auth { | 15 namespace proximity_auth { |
11 | 16 |
12 class ProximityAuthService; | 17 class ProximityAuthService; |
13 | 18 |
14 // Handles messages from the chrome://proximity-auth page. | 19 // Handles messages from the chrome://proximity-auth page. |
15 class ProximityAuthWebUIHandler : public content::WebUIMessageHandler { | 20 class ProximityAuthWebUIHandler : public content::WebUIMessageHandler, |
| 21 public LogBuffer::Observer { |
16 public: | 22 public: |
17 ProximityAuthWebUIHandler(); | 23 ProximityAuthWebUIHandler(); |
18 ~ProximityAuthWebUIHandler() override; | 24 ~ProximityAuthWebUIHandler() override; |
19 | 25 |
20 // content::WebUIMessageHandler implementation. | 26 // content::WebUIMessageHandler: |
21 void RegisterMessages() override; | 27 void RegisterMessages() override; |
22 | 28 |
23 private: | 29 private: |
| 30 // LogBuffer::Observer: |
| 31 void OnLogMessageAdded(const LogBuffer::LogMessage& log_message) override; |
| 32 void OnLogBufferCleared() override; |
| 33 |
| 34 // Message handler callbacks. |
| 35 void GetLogMessages(const base::ListValue* args); |
| 36 void ClearLogBuffer(const base::ListValue* args); |
| 37 |
24 DISALLOW_COPY_AND_ASSIGN(ProximityAuthWebUIHandler); | 38 DISALLOW_COPY_AND_ASSIGN(ProximityAuthWebUIHandler); |
25 }; | 39 }; |
26 | 40 |
27 } // namespace proximity_auth | 41 } // namespace proximity_auth |
28 | 42 |
29 #endif // COMPONENTS_PROXIMITY_AUTH_WEBUI_PROXIMITY_AUTH_WEBUI_HANDLER_H_ | 43 #endif // COMPONENTS_PROXIMITY_AUTH_WEBUI_PROXIMITY_AUTH_WEBUI_HANDLER_H_ |
OLD | NEW |