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

Unified Diff: chrome/browser/extensions/app_notify_channel_setup.h

Issue 8400027: Add code to prompt for browser login during app notification setup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/app_notify_channel_setup.h
diff --git a/chrome/browser/extensions/app_notify_channel_setup.h b/chrome/browser/extensions/app_notify_channel_setup.h
index 9a27a41a282079d4a6bf08437e637d8c3380c413..7c562755e848ed03d8aa5415995840836db27767 100644
--- a/chrome/browser/extensions/app_notify_channel_setup.h
+++ b/chrome/browser/extensions/app_notify_channel_setup.h
@@ -8,6 +8,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "chrome/browser/extensions/app_notify_channel_ui.h"
#include "content/public/common/url_fetcher_delegate.h"
#include "googleurl/src/gurl.h"
@@ -17,6 +18,7 @@ class Profile;
// app to use when sending server push notifications.
class AppNotifyChannelSetup
: public content::URLFetcherDelegate,
+ public AppNotifyChannelUI::Delegate,
public base::RefCountedThreadSafe<AppNotifyChannelSetup> {
public:
class Delegate {
@@ -30,27 +32,32 @@ class AppNotifyChannelSetup
int callback_id) = 0;
};
+ // Ownership of |ui| is transferred to this object.
AppNotifyChannelSetup(Profile* profile,
const std::string& client_id,
const GURL& requestor_url,
int return_route_id,
int callback_id,
+ AppNotifyChannelUI* ui,
base::WeakPtr<Delegate> delegate);
// This begins the process of fetching the channel id using the browser login
- // credentials. If the user isn't logged in to chrome, this will first cause a
- // prompt to appear asking the user to log in.
+ // credentials (or using |ui_| to prompt for login if needed).
void Start();
protected:
// content::URLFetcherDelegate.
virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE;
+ // AppNotifyChannelUI::Delegate.
+ virtual void OnSyncSetupResult(bool enabled) OVERRIDE;
+
private:
friend class base::RefCountedThreadSafe<AppNotifyChannelSetup>;
-
virtual ~AppNotifyChannelSetup();
+ void BeginFetch();
+
void ReportResult(const std::string& channel_id, const std::string& error);
Profile* profile_;
@@ -60,6 +67,7 @@ class AppNotifyChannelSetup
int callback_id_;
base::WeakPtr<Delegate> delegate_;
scoped_ptr<content::URLFetcher> url_fetcher_;
+ scoped_ptr<AppNotifyChannelUI> ui_;
DISALLOW_COPY_AND_ASSIGN(AppNotifyChannelSetup);
};

Powered by Google App Engine
This is Rietveld 408576698