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 #ifndef CHROME_BROWSER_EXTENSIONS_APP_NOTIFY_CHANNEL_UI_H_ | |
6 #define CHROME_BROWSER_EXTENSIONS_APP_NOTIFY_CHANNEL_UI_H_ | |
7 | |
8 #include <string> | |
9 | |
10 class Profile; | |
11 | |
12 namespace content { | |
13 class WebContents; | |
14 } | |
15 | |
16 namespace extensions { | |
17 | |
18 // An interface for prompting a user to sign in to sync so that we can create | |
19 // an app notification channel for one of their apps. | |
20 class AppNotifyChannelUI { | |
21 public: | |
22 virtual ~AppNotifyChannelUI() {} | |
23 | |
24 // Used to customize the UI we show. | |
25 enum UIType { | |
26 // Do not prompt the user with an infobar. | |
27 NO_INFOBAR, | |
28 | |
29 // Ask if the app can show notifications. | |
30 NOTIFICATION_INFOBAR, | |
31 }; | |
32 | |
33 class Delegate { | |
34 public: | |
35 // A callback for whether the user successfully set up sync or not. | |
36 virtual void OnSyncSetupResult(bool enabled) = 0; | |
37 | |
38 protected: | |
39 virtual ~Delegate() {} | |
40 }; | |
41 | |
42 // Shows a prompt for sync setup - |delegate| will be called back later when | |
43 // setup is complete or cancelled. This should only be called once per | |
44 // instance. | |
45 virtual void PromptSyncSetup(Delegate* delegate) = 0; | |
46 | |
47 // Builds the platform specific AppNotifyChannelUI. | |
48 static AppNotifyChannelUI* Create(Profile* profile, | |
49 content::WebContents* web_contents, | |
50 const std::string& app_name, | |
51 AppNotifyChannelUI::UIType ui_type); | |
52 }; | |
53 | |
54 } // namespace extensions | |
55 | |
56 #endif // CHROME_BROWSER_EXTENSIONS_APP_NOTIFY_CHANNEL_UI_H_ | |
OLD | NEW |