Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / webui / password_manager_internals / password_manager_internals_ui.h
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   ~PasswordManagerInternalsUI() override;
18
19   // WebContentsObserver implementation.
20   void DidStartLoading(content::RenderViewHost* render_view_host) override;
21   void DidStopLoading(content::RenderViewHost* render_view_host) override;
22
23   // LogReceiver implementation.
24   void LogSavePasswordProgress(const std::string& text) override;
25
26  private:
27   // If currently registered with PasswordManagerInternalsService, unregisters
28   // |this|. Otherwise this is a no-op.
29   void UnregisterFromLoggingService();
30
31   // Whether |this| registered as a log receiver with the
32   // PasswordManagerInternalsService.
33   bool registered_with_logging_service_;
34
35   DISALLOW_COPY_AND_ASSIGN(PasswordManagerInternalsUI);
36 };
37
38 #endif  // CHROME_BROWSER_UI_WEBUI_PASSWORD_MANAGER_INTERNALS_PASSWORD_MANAGER_INTERNALS_UI_H_