• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
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_
7 
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"
11 
12 class PasswordManagerInternalsUI : public content::WebUIController,
13                                    public content::WebContentsObserver,
14                                    public password_manager::LogReceiver {
15  public:
16   explicit PasswordManagerInternalsUI(content::WebUI* web_ui);
17   virtual ~PasswordManagerInternalsUI();
18 
19   // WebContentsObserver implementation.
20   virtual void DidStartLoading(
21       content::RenderViewHost* render_view_host) OVERRIDE;
22   virtual void DidStopLoading(
23       content::RenderViewHost* render_view_host) OVERRIDE;
24 
25   // LogReceiver implementation.
26   virtual void LogSavePasswordProgress(const std::string& text) OVERRIDE;
27 
28  private:
29   // If currently registered with PasswordManagerInternalsService, unregisters
30   // |this|. Otherwise this is a no-op.
31   void UnregisterFromLoggingService();
32 
33   // Whether |this| registered as a log receiver with the
34   // PasswordManagerInternalsService.
35   bool registered_with_logging_service_;
36 
37   DISALLOW_COPY_AND_ASSIGN(PasswordManagerInternalsUI);
38 };
39 
40 #endif  // CHROME_BROWSER_UI_WEBUI_PASSWORD_MANAGER_INTERNALS_PASSWORD_MANAGER_INTERNALS_UI_H_
41