Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Side by Side Diff: chrome/browser/sync/sync_global_error.h

Issue 7906013: Show bubble and wrench menu item for sync error (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 // Shows sync errors on the wrench menu using a bubble view and a
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698