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

Unified Diff: chrome/browser/sync/notifier/communicator/talk_auth_task.h

Issue 194065: Initial commit of sync engine code to browser/sync.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fixes to gtest include path, reverted syncapi. Created 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/notifier/communicator/talk_auth_task.h
===================================================================
--- chrome/browser/sync/notifier/communicator/talk_auth_task.h (revision 0)
+++ chrome/browser/sync/notifier/communicator/talk_auth_task.h (revision 0)
@@ -0,0 +1,62 @@
+// Copyright (c) 2009 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_SYNC_NOTIFIER_COMMUNICATOR_TALK_AUTH_TASK_H_
+#define CHROME_BROWSER_SYNC_NOTIFIER_COMMUNICATOR_TALK_AUTH_TASK_H_
+
+#include "talk/base/scoped_ptr.h"
+#include "talk/base/sigslot.h"
+#include "talk/base/task.h"
+
+namespace buzz {
+class GaiaAuth;
+}
+
+namespace notifier {
+class Login;
+
+// Create an authenticated talk url from an unauthenticated url
+class TalkAuthTask : public talk_base::Task, public sigslot::has_slots<> {
+ public:
+ TalkAuthTask(talk_base::Task* parent,
+ Login* login,
+ const char* url);
+
+ // An abort method which doesn't take any parameters.
+ // (talk_base::Task::Abort() has a default parameter.)
+ //
+ // The primary purpose of this method is to allow a
+ // signal to be hooked up to abort this task.
+ void Abort() {
+ talk_base::Task::Abort();
+ }
+
+ const std::string& url() {
+ return url_;
+ }
+
+ std::string GetAuthenticatedUrl(const char* talk_base_url) const;
+ std::string GetSID() const;
+
+ sigslot::signal1<const TalkAuthTask&> SignalAuthDone;
+
+ bool HadError() const;
+
+ // TODO(sync): add captcha support
+
+ protected:
+ virtual int ProcessStart();
+ virtual int ProcessResponse();
+
+ private:
+ void OnAuthDone();
+
+ scoped_ptr<buzz::GaiaAuth> auth_;
+ Login* login_;
+ std::string url_;
+ DISALLOW_COPY_AND_ASSIGN(TalkAuthTask);
+};
+} // namespace notifier
+
+#endif // CHROME_BROWSER_SYNC_NOTIFIER_COMMUNICATOR_TALK_AUTH_TASK_H_
Property changes on: chrome\browser\sync\notifier\communicator\talk_auth_task.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698