a2e62a2cdd4eb8f2c1c64187df42c248abc31f80
[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/password_manager_logger.h"
9 #include "content/public/browser/web_ui_controller.h"
10
11 class PasswordManagerInternalsUI : public content::WebUIController,
12                                    public PasswordManagerLogger {
13  public:
14   explicit PasswordManagerInternalsUI(content::WebUI* web_ui);
15   virtual ~PasswordManagerInternalsUI();
16
17   // PasswordManagerLogger implementation.
18   virtual void LogSavePasswordProgress(const std::string& text) OVERRIDE;
19
20  private:
21   // These types describe which kinds of notifications
22   // PasswordManagerInternalsUI can send to PasswordManagerClient.
23   enum ClientNotificationType {
24     PAGE_OPENED,  // Send when the page gets opened.
25     PAGE_CLOSED   // Send when the page gets closed.
26   };
27
28   // This acts on all PasswordManagerClient instances of the current profile
29   // based on |notification_type|:
30   // PAGE_OPENED -- |this| is set as clients' PasswordManagerLogger
31   // PAGE_CLOSED -- PasswordManagerLogger is reset for clients
32   void NotifyAllPasswordManagerClients(
33       ClientNotificationType notification_type);
34
35   DISALLOW_COPY_AND_ASSIGN(PasswordManagerInternalsUI);
36 };
37
38 #endif  // CHROME_BROWSER_UI_WEBUI_PASSWORD_MANAGER_INTERNALS_PASSWORD_MANAGER_INTERNALS_UI_H_