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

Side by Side Diff: chrome/browser/chromeos/login/string_fetcher.h

Issue 3026048: Fetch OEM services customization manifest from URL async.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_STRING_FETCHER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_STRING_FETCHER_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/scoped_ptr.h"
12 #include "chrome/common/net/url_fetcher.h"
13
14 // This class is used to fetch an URL and store result as a string.
15 class StringFetcher : public URLFetcher::Delegate {
16 public:
17 // Initiates URL fetch.
18 explicit StringFetcher(const std::string& url);
19
20 const std::string& result() const { return result_; }
21 int response_code() const { return response_code_; }
22 bool succeeded() const { return response_code_ == 200; }
23
24 private:
25 // Overriden from URLFetcher::Delegate:
26 virtual void OnURLFetchComplete(const URLFetcher* source,
27 const GURL& url,
28 const URLRequestStatus& status,
29 int response_code,
30 const ResponseCookies& cookies,
31 const std::string& data);
32 // Timer notification handler.
33 void OnTimeoutElapsed();
34
35 // URLFetcher instance.
36 scoped_ptr<URLFetcher> url_fetcher_;
37
38 // Fetch result.
39 std::string result_;
40
41 // Received HTTP response code.
42 int response_code_;
43
44 DISALLOW_COPY_AND_ASSIGN(StringFetcher);
45 };
46
47 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_STRING_FETCHER_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/apply_services_customization.cc ('k') | chrome/browser/chromeos/login/string_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698