Disable TabDragController tests that fail with a real compositor.
[chromium-blink-merge.git] / chrome / browser / ui / webui / options / password_manager_handler.h
blobbae096bcbfc32b7f847e5adb06b720b6337b48fd
1 // Copyright 2013 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_OPTIONS_PASSWORD_MANAGER_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_
8 #include <string>
9 #include <vector>
11 #include "base/prefs/pref_member.h"
12 #include "chrome/browser/ui/passwords/password_manager_presenter.h"
13 #include "chrome/browser/ui/passwords/password_ui_view.h"
14 #include "chrome/browser/ui/webui/options/options_ui.h"
16 namespace options {
18 // The WebUI based PasswordUIView. Displays passwords in the web ui.
19 class PasswordManagerHandler : public OptionsPageUIHandler,
20 public PasswordUIView {
21 public:
22 PasswordManagerHandler();
23 virtual ~PasswordManagerHandler();
25 // OptionsPageUIHandler implementation.
26 virtual void GetLocalizedValues(
27 base::DictionaryValue* localized_strings) OVERRIDE;
28 virtual void InitializeHandler() OVERRIDE;
29 virtual void RegisterMessages() OVERRIDE;
31 // PasswordUIView implementation.
32 virtual Profile* GetProfile() OVERRIDE;
33 virtual void ShowPassword(size_t index, const base::string16& password_value)
34 OVERRIDE;
35 virtual void SetPasswordList(
36 const ScopedVector<autofill::PasswordForm>& password_list,
37 bool show_passwords) OVERRIDE;
38 virtual void SetPasswordExceptionList(
39 const ScopedVector<autofill::PasswordForm>& password_exception_list)
40 OVERRIDE;
41 #if !defined(OS_ANDROID)
42 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE;
43 #endif
44 private:
45 // Clears and then populates the list of passwords and password exceptions.
46 // Called when the JS PasswordManager object is initialized.
47 void HandleUpdatePasswordLists(const base::ListValue* args);
49 // Removes a saved password entry.
50 // |value| the entry index to be removed.
51 void HandleRemoveSavedPassword(const base::ListValue* args);
53 // Removes a saved password exception.
54 // |value| the entry index to be removed.
55 void HandleRemovePasswordException(const base::ListValue* args);
57 // Requests the plain text password for an entry to be revealed.
58 // |index| The index of the entry.
59 void HandleRequestShowPassword(const base::ListValue* args);
61 // User pref for storing accept languages.
62 std::string languages_;
64 // The PasswordManagerPresenter object owned by the this view.
65 PasswordManagerPresenter password_manager_presenter_;
67 DISALLOW_COPY_AND_ASSIGN(PasswordManagerHandler);
70 } // namespace options
72 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_