blob: 4192471aaecfb73f5b001c4940ccdf1126e6bbbb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_APP_NOTIFY_CHANNEL_UI_H_
#define CHROME_BROWSER_EXTENSIONS_APP_NOTIFY_CHANNEL_UI_H_
#include <string>
class Profile;
class TabContents;
namespace extensions {
// An interface for prompting a user to sign in to sync so that we can create
// an app notification channel for one of their apps.
class AppNotifyChannelUI {
public:
virtual ~AppNotifyChannelUI() {}
// Used to customize the UI we show.
enum UIType {
// Do not prompt the user with an infobar.
NO_INFOBAR,
// Ask if the app can show notifications.
NOTIFICATION_INFOBAR,
};
class Delegate {
public:
// A callback for whether the user successfully set up sync or not.
virtual void OnSyncSetupResult(bool enabled) = 0;
protected:
virtual ~Delegate() {}
};
// Shows a prompt for sync setup - |delegate| will be called back later when
// setup is complete or cancelled. This should only be called once per
// instance.
virtual void PromptSyncSetup(Delegate* delegate) = 0;
// Builds the platform specific AppNotifyChannelUI.
static AppNotifyChannelUI* Create(Profile* profile,
TabContents* tab_contents,
const std::string& app_name,
AppNotifyChannelUI::UIType ui_type);
};
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_APP_NOTIFY_CHANNEL_UI_H_
|