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_PROXY_CHROME_KEYRING_PROXY_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PROXY_CHROME_KEYRING_PROXY_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/password_manager/proxy/keyring_loader.h" |
| 11 #include "chrome/browser/password_manager/proxy/message_reader.h" |
| 12 |
| 13 // Forward declarations of GLib stuff. |
| 14 typedef struct _GMainLoop GMainLoop; |
| 15 typedef struct _GSource GSource; |
| 16 |
| 17 class MessageProcessor; |
| 18 |
| 19 // This class just contains constants used as command characters in the wire |
| 20 // protocol for communicating with the keyring proxy. |
| 21 class ChromeKeyringProxyCommands { |
| 22 public: |
| 23 static const char kAddLogin = 'A'; |
| 24 static const char kRemoveLogin = 'R'; |
| 25 static const char kAddLoginSearch = 'a'; |
| 26 static const char kUpdateLoginSearch = 'u'; |
| 27 static const char kGetLogins = 'g'; |
| 28 static const char kGetLoginsList = 'l'; |
| 29 static const char kGetAllLogins = '*'; |
| 30 }; |
| 31 |
| 32 class ChromeKeyringProxy : public GnomeKeyringLoader { |
| 33 public: |
| 34 ChromeKeyringProxy(int fd, FILE* output); |
| 35 |
| 36 ~ChromeKeyringProxy(); |
| 37 |
| 38 bool Init(); |
| 39 void Run(); |
| 40 void Stop(); |
| 41 |
| 42 private: |
| 43 void ReadData(); |
| 44 |
| 45 static gboolean DataReady(gpointer data); |
| 46 |
| 47 int fd_; |
| 48 GMainLoop* main_loop_; |
| 49 GSource* input_; |
| 50 MessageReader reader_; |
| 51 scoped_ptr<MessageProcessor> processor_; |
| 52 }; |
| 53 |
| 54 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PROXY_CHROME_KEYRING_PROXY_H_ |
OLD | NEW |