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

Side by Side Diff: chrome/browser/extensions/convert_web_app.h

Issue 4471001: Reland http://codereview.chromium.org/4139008, with a different (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: this crap still does not work Created 10 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 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_EXTENSIONS_CONVERT_WEB_APP_H_
6 #define CHROME_BROWSER_EXTENSIONS_CONVERT_WEB_APP_H_
7 #pragma once
8
9 #include <string>
10
11 #include "base/ref_counted.h"
12
13 class Extension;
14
15 namespace base {
16 class Time;
17 }
18
19 namespace webkit_glue {
20 struct WebApplicationInfo;
21 }
22
23 // Generates a version number for an extension from a time. The goal is to make
24 // use of the version number to communicate the date in a human readable form,
25 // while maintaining high enough resolution to change each time an app is
26 // reinstalled. The version that is returned has the format:
27 //
28 // <year>.<month>.<day>.<fraction>
29 //
30 // fraction is represented as a number between 0 and 2^16-1. Each unit is
31 // ~1.32 seconds.
32 std::string ConvertTimeToExtensionVersion(const base::Time& time);
33
34 // Wraps the specified web app in an extension. The extension is created
35 // unpacked in the system temp dir. Returns a valid extension that the caller
36 // should take ownership on success, or NULL and |error| on failure.
37 //
38 // NOTE: This function does file IO and should not be called on the UI thread.
39 // NOTE: The caller takes ownership of the directory at extension->path() on the
40 // returned object.
41 scoped_refptr<Extension> ConvertWebAppToExtension(
42 const webkit_glue::WebApplicationInfo& web_app_info,
43 const base::Time& create_time);
44
45 #endif // CHROME_BROWSER_EXTENSIONS_CONVERT_WEB_APP_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/convert_user_script.h ('k') | chrome/browser/extensions/convert_web_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698