1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_WEBUI_PASSWORD_MANAGER_INTERNALS_PASSWORD_MANAGER_INTERNALS_UI_H_
6 #define CHROME_BROWSER_UI_WEBUI_PASSWORD_MANAGER_INTERNALS_PASSWORD_MANAGER_INTERNALS_UI_H_
8 #include "components/password_manager/core/browser/log_receiver.h"
9 #include "content/public/browser/web_contents_observer.h"
10 #include "content/public/browser/web_ui_controller.h"
12 class PasswordManagerInternalsUI : public content::WebUIController,
13 public content::WebContentsObserver,
14 public password_manager::LogReceiver {
16 explicit PasswordManagerInternalsUI(content::WebUI* web_ui);
17 ~PasswordManagerInternalsUI() override;
19 // WebContentsObserver implementation.
20 void DidStartLoading(content::RenderViewHost* render_view_host) override;
21 void DidStopLoading(content::RenderViewHost* render_view_host) override;
23 // LogReceiver implementation.
24 void LogSavePasswordProgress(const std::string& text) override;
27 // If currently registered with PasswordManagerInternalsService, unregisters
28 // |this|. Otherwise this is a no-op.
29 void UnregisterFromLoggingService();
31 // Whether |this| registered as a log receiver with the
32 // PasswordManagerInternalsService.
33 bool registered_with_logging_service_;
35 DISALLOW_COPY_AND_ASSIGN(PasswordManagerInternalsUI);
38 #endif // CHROME_BROWSER_UI_WEBUI_PASSWORD_MANAGER_INTERNALS_PASSWORD_MANAGER_INTERNALS_UI_H_