OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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_PASSWORD_MANAGER_KEYRING_PROXY_KEYRING_PROXY_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_KEYRING_PROXY_KEYRING_PROXY_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/password_manager/keyring_proxy/gnome_keyring_loader.h" |
| 11 #include "chrome/browser/password_manager/keyring_proxy/message_reader.h" |
| 12 |
| 13 // Forward declarations of GLib stuff. |
| 14 typedef struct _GMainLoop GMainLoop; |
| 15 typedef struct _GSource GSource; |
| 16 |
| 17 namespace keyring_proxy { |
| 18 |
| 19 class MessageProcessor; |
| 20 |
| 21 class KeyringProxy : public GnomeKeyringLoader { |
| 22 public: |
| 23 // These are the command characters in the wire protocol for communicating |
| 24 // with the keyring proxy. |
| 25 static const char kAddLoginCommand = 'A'; |
| 26 static const char kRemoveLoginCommand = 'R'; |
| 27 static const char kAddLoginSearchCommand = 'a'; |
| 28 static const char kUpdateLoginSearchCommand = 'u'; |
| 29 static const char kGetLoginsCommand = 'g'; |
| 30 static const char kGetLoginsListCommand = 'l'; |
| 31 static const char kGetAllLoginsCommand = '*'; |
| 32 |
| 33 KeyringProxy(int fd, FILE* output); |
| 34 |
| 35 ~KeyringProxy(); |
| 36 |
| 37 bool Init(); |
| 38 void Run(); |
| 39 void Stop(); |
| 40 |
| 41 private: |
| 42 void ReadData(); |
| 43 |
| 44 static gboolean DataReady(gpointer data); |
| 45 |
| 46 int fd_; |
| 47 GMainLoop* main_loop_; |
| 48 GSource* input_; |
| 49 MessageReader reader_; |
| 50 scoped_ptr<MessageProcessor> processor_; |
| 51 }; |
| 52 |
| 53 } // namespace keyring_proxy |
| 54 |
| 55 #endif // CHROME_BROWSER_PASSWORD_MANAGER_KEYRING_PROXY_KEYRING_PROXY_H_ |
OLD | NEW |