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

Unified Diff: chrome/browser/chromeos/version_loader.h

Issue 6883142: Show ChromeOS bios firmware in about dialog. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 8 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/chromeos/version_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/version_loader.h
===================================================================
--- chrome/browser/chromeos/version_loader.h (revision 82505)
+++ chrome/browser/chromeos/version_loader.h (working copy)
@@ -28,6 +28,9 @@
// void OnGetChromeOSVersion(chromeos::VersionLoader::Handle,
// std::string version);
// . When you want the version invoke: loader.GetVersion(&consumer, callback);
+//
+// This class also provides the ability to load the bios firmware using
+// loader.GetFirmware(&consumer, callback);
class VersionLoader : public CancelableRequestProvider {
public:
VersionLoader();
@@ -40,9 +43,11 @@
// Signature
typedef Callback2<Handle, std::string>::Type GetVersionCallback;
-
typedef CancelableRequest<GetVersionCallback> GetVersionRequest;
+ typedef Callback2<Handle, std::string>::Type GetFirmwareCallback;
+ typedef CancelableRequest<GetFirmwareCallback> GetFirmwareRequest;
+
// Asynchronously requests the version.
// If |full_version| is true version string with extra info is extracted,
// otherwise it's in short format x.x.xx.x.
@@ -50,12 +55,17 @@
GetVersionCallback* callback,
VersionFormat format);
+ Handle GetFirmware(CancelableRequestConsumerBase* consumer,
+ GetFirmwareCallback* callback);
+
static const char kFullVersionPrefix[];
static const char kVersionPrefix[];
+ static const char kFirmwarePrefix[];
private:
FRIEND_TEST_ALL_PREFIXES(VersionLoaderTest, ParseFullVersion);
FRIEND_TEST_ALL_PREFIXES(VersionLoaderTest, ParseVersion);
+ FRIEND_TEST_ALL_PREFIXES(VersionLoaderTest, ParseFirmware);
// VersionLoader calls into the Backend on the file thread to load
// and extract the version.
@@ -69,6 +79,10 @@
void GetVersion(scoped_refptr<GetVersionRequest> request,
VersionFormat format);
+ // Calls ParseFirmware to get the firmware # and notifies request.
+ // This is invoked on the file thread.
+ void GetFirmware(scoped_refptr<GetFirmwareRequest> request);
+
private:
friend class base::RefCountedThreadSafe<Backend>;
@@ -82,6 +96,9 @@
static std::string ParseVersion(const std::string& contents,
const std::string& prefix);
+ // Extracts the firmware from the file.
+ static std::string ParseFirmware(const std::string& contents);
+
scoped_refptr<Backend> backend_;
DISALLOW_COPY_AND_ASSIGN(VersionLoader);
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/chromeos/version_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698