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_SYNC_SYNC_GLOBAL_ERROR_H_ | |
6 #define CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_H_ | |
7 #pragma once | |
8 | |
9 #include "base/basictypes.h" | |
10 #include "base/compiler_specific.h" | |
11 #include "chrome/browser/sync/profile_sync_service_observer.h" | |
12 #include "chrome/browser/ui/global_error.h" | |
13 | |
14 class ProfileSyncService; | |
15 | |
16 // This class shows sync errors on the wrench menu using a bubble view and a | |
James Hawkins
2011/09/15 19:40:26
nit: No need to specify "This class" for class com
sail
2011/09/15 20:22:52
Done.
| |
17 // menu item. | |
18 class SyncGlobalError : public GlobalError, | |
19 public ProfileSyncServiceObserver { | |
20 public: | |
21 explicit SyncGlobalError(ProfileSyncService* service); | |
22 virtual ~SyncGlobalError(); | |
23 | |
24 virtual bool HasBadge() OVERRIDE; | |
25 | |
26 virtual bool HasMenuItem() OVERRIDE; | |
27 virtual int MenuItemCommandID() OVERRIDE; | |
28 virtual string16 MenuItemLabel() OVERRIDE; | |
29 virtual void ExecuteMenuItem(Browser* browser) OVERRIDE; | |
30 | |
31 virtual bool HasBubbleView() OVERRIDE; | |
32 virtual string16 GetBubbleViewTitle() OVERRIDE; | |
33 virtual string16 GetBubbleViewMessage() OVERRIDE; | |
34 virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE; | |
35 virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE; | |
36 virtual void BubbleViewDidClose() OVERRIDE; | |
37 virtual void BubbleViewAcceptButtonPressed() OVERRIDE; | |
38 virtual void BubbleViewCancelButtonPressed() OVERRIDE; | |
39 | |
40 // ProfileSyncServiceObserver implementation. | |
41 virtual void OnStateChanged() OVERRIDE; | |
42 | |
43 // For non-ChromeOS we customize the "Sign in to sync" wrench menu item | |
44 // instead of adding a new wrench menu item at the bottom. | |
45 bool HasCustomizedSyncMenuItem(); | |
46 | |
47 private: | |
48 enum ErrorType { | |
49 ERROR_TYPE_NONE, | |
50 ERROR_TYPE_PASSPHRASE, | |
51 ERROR_TYPE_SIGN_IN, | |
52 ERROR_TYPE_UNAVAILABLE, | |
53 ERROR_TYPE_OTHER, | |
54 }; | |
55 | |
56 ErrorType GetUpdatedErrorType(); | |
57 | |
58 ErrorType error_type_; | |
59 ProfileSyncService* service_; | |
60 | |
61 DISALLOW_COPY_AND_ASSIGN(SyncGlobalError); | |
62 }; | |
63 | |
64 #endif // CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_H_ | |
OLD | NEW |