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

Unified Diff: chrome/browser/chromeos/login/string_fetcher.h

Issue 3064002: Landing OEM customization CL for Denis... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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/chromeos/login/string_fetcher.h
===================================================================
--- chrome/browser/chromeos/login/string_fetcher.h (revision 0)
+++ chrome/browser/chromeos/login/string_fetcher.h (revision 0)
@@ -0,0 +1,47 @@
+// Copyright (c) 2010 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_CHROMEOS_LOGIN_STRING_FETCHER_H_
+#define CHROME_BROWSER_CHROMEOS_LOGIN_STRING_FETCHER_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/scoped_ptr.h"
+#include "chrome/common/net/url_fetcher.h"
+
+// This class is used to fetch an URL and store result as a string.
+class StringFetcher : public URLFetcher::Delegate {
+ public:
+ // Initiates URL fetch.
+ explicit StringFetcher(const std::string& url);
+
+ const std::string& result() const { return result_; }
+ int response_code() const { return response_code_; }
+ bool succeeded() const { return response_code_ == 200; }
+
+ private:
+ // Overriden from URLFetcher::Delegate:
+ virtual void OnURLFetchComplete(const URLFetcher* source,
+ const GURL& url,
+ const URLRequestStatus& status,
+ int response_code,
+ const ResponseCookies& cookies,
+ const std::string& data);
+ // Timer notification handler.
+ void OnTimeoutElapsed();
+
+ // URLFetcher instance.
+ scoped_ptr<URLFetcher> url_fetcher_;
+
+ // Fetch result.
+ std::string result_;
+
+ // Received HTTP response code.
+ int response_code_;
+
+ DISALLOW_COPY_AND_ASSIGN(StringFetcher);
+};
+
+#endif // CHROME_BROWSER_CHROMEOS_LOGIN_STRING_FETCHER_H_
Property changes on: chrome/browser/chromeos/login/string_fetcher.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698