| OLD | NEW |
| (Empty) | |
| 1 # Copyright (c) 2012 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 import chrome_remote_control.google_credentials_backend as \ |
| 6 google_credentials_backend |
| 7 import logging |
| 8 |
| 9 class BrowserCredentials(object): |
| 10 def __init__(self): |
| 11 self._credentials_backends = \ |
| 12 [google_credentials_backend.GoogleCredentialsBackend()] |
| 13 |
| 14 def _GetCredentialsBackend(self, credentials_type): |
| 15 for backend in self._credentials_backends: |
| 16 if credentials_type == backend.label: |
| 17 return backend |
| 18 |
| 19 def LoginNeeded(self, credentials_type, tab): |
| 20 backend = self._GetCredentialsBackend(credentials_type) |
| 21 if backend: |
| 22 backend.LoginNeeded(tab) |
| 23 else: |
| 24 logging.warning('Credentials not implemented: "%s"', credentials_type) |
| 25 |
| 26 def LoginNoLongerNeeded(self, credentials_type, tab): |
| 27 backend = self._GetCredentialsBackend(credentials_type) |
| 28 if backend: |
| 29 backend.LoginNoLongerNeeded(tab) |
| 30 else: |
| 31 logging.warning('Credentials not implemented: "%s"', credentials_type) |
| OLD | NEW |