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

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

Issue 8727024: Save the oauth client id used in App Notification setup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed nits Created 9 years, 1 month 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 d960ee0810a3b480217f11b972201fab3a53e179..e82c2b0cface7c87b7bff3a34b1437fb18ab378c 100644
--- a/chrome/browser/extensions/app_notify_channel_setup.h
+++ b/chrome/browser/extensions/app_notify_channel_setup.h
@@ -42,12 +42,22 @@ class AppNotifyChannelSetup
// If successful, |channel_id| will be non-empty. On failure, |channel_id|
// will be empty and |error| will contain an error to report to the JS
// callback.
- virtual void AppNotifyChannelSetupComplete(const std::string& channel_id,
- const std::string& error,
- int return_route_id,
- int callback_id) = 0;
+ virtual void AppNotifyChannelSetupComplete(
+ const std::string& channel_id,
+ const std::string& error,
+ const AppNotifyChannelSetup* setup) = 0;
};
+ // For tests, we allow intercepting the request to setup the channel and
+ // forcing the return of a certain result to the delegate.
+ class InterceptorForTests {
+ public:
+ virtual void DoIntercept(const AppNotifyChannelSetup* setup,
+ std::string* result_channel_id,
+ std::string* result_error) = 0;
+ };
+ static void SetInterceptorForTests(InterceptorForTests* interceptor);
+
// Ownership of |ui| is transferred to this object.
AppNotifyChannelSetup(Profile* profile,
const std::string& extension_id,
@@ -68,6 +78,13 @@ class AppNotifyChannelSetup
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+
+ // Getters for various members.
+ const std::string& extension_id() const { return extension_id_; }
+ const std::string& client_id() const { return client_id_; }
+ int return_route_id() const { return return_route_id_; }
+ int callback_id() const { return callback_id_; }
+
protected:
// content::URLFetcherDelegate.
virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE;
« no previous file with comments | « chrome/browser/extensions/app_notification_browsertest.cc ('k') | chrome/browser/extensions/app_notify_channel_setup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698