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

Side by Side Diff: chrome/browser/platform_util.h

Issue 7249003: Move GetVersionStringModifier() and GetChannel() from platform_util_* to chrome_version_info_* (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: correct nits Created 9 years, 6 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
« no previous file with comments | « chrome/browser/mac/keystone_glue.mm ('k') | chrome/browser/platform_util_common_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_PLATFORM_UTIL_H_ 5 #ifndef CHROME_BROWSER_PLATFORM_UTIL_H_
6 #define CHROME_BROWSER_PLATFORM_UTIL_H_ 6 #define CHROME_BROWSER_PLATFORM_UTIL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/string16.h" 11 #include "base/string16.h"
12 #include "ui/gfx/native_widget_types.h" 12 #include "ui/gfx/native_widget_types.h"
13 13
14 class FilePath; 14 class FilePath;
15 class GURL; 15 class GURL;
16 16
17 namespace platform_util { 17 namespace platform_util {
18 18
19 // The possible channels for an installation, from most fun to most stable.
20 enum Channel {
21 CHANNEL_UNKNOWN = 0, // Probably blue
22 CHANNEL_CANARY, // Yellow
23 CHANNEL_DEV, // Technicolor
24 CHANNEL_BETA, // Rainbow
25 CHANNEL_STABLE // Full-spectrum
26 };
27
28 // Show the given file in a file manager. If possible, select the file. 19 // Show the given file in a file manager. If possible, select the file.
29 void ShowItemInFolder(const FilePath& full_path); 20 void ShowItemInFolder(const FilePath& full_path);
30 21
31 // Open the given file in the desktop's default manner. 22 // Open the given file in the desktop's default manner.
32 void OpenItem(const FilePath& full_path); 23 void OpenItem(const FilePath& full_path);
33 24
34 // Open the given external protocol URL in the desktop's default manner. 25 // Open the given external protocol URL in the desktop's default manner.
35 // (For example, mailto: URLs in the default mail user agent.) 26 // (For example, mailto: URLs in the default mail user agent.)
36 void OpenExternal(const GURL& url); 27 void OpenExternal(const GURL& url);
37 28
(...skipping 21 matching lines...) Expand all
59 const string16& title, 50 const string16& title,
60 const string16& message); 51 const string16& message);
61 52
62 // Pops up a dialog box with two buttons (Yes/No), with the default button of 53 // Pops up a dialog box with two buttons (Yes/No), with the default button of
63 // Yes. If |parent| is non-null, the box will be modal on it. (On Mac, it is 54 // Yes. If |parent| is non-null, the box will be modal on it. (On Mac, it is
64 // always app-modal.) Returns true if the Yes button was chosen. 55 // always app-modal.) Returns true if the Yes button was chosen.
65 bool SimpleYesNoBox(gfx::NativeWindow parent, 56 bool SimpleYesNoBox(gfx::NativeWindow parent,
66 const string16& title, 57 const string16& title,
67 const string16& message); 58 const string16& message);
68 59
69 // Returns a human-readable modifier for the version string. For a branded
70 // build, this modifier is the channel ("canary", "dev", or "beta", but ""
71 // for stable). On Windows, this may be modified with additional information
72 // after a hyphen. For multi-user installations, it will return "canary-m",
73 // "dev-m", "beta-m", and for a stable channel multi-user installation, "m".
74 // In branded builds, when the channel cannot be determined, "unknown" will
75 // be returned. In unbranded builds, the modifier is usually an empty string
76 // (""), although on Linux, it may vary in certain distributions.
77 // GetVersionStringModifier() is intended to be used for display purposes.
78 // To simply test the channel, use GetChannel().
79 std::string GetVersionStringModifier();
80
81 // Returns the channel for the installation. In branded builds, this will be
82 // CHANNEL_STABLE, CHANNEL_BETA, CHANNEL_DEV, or CHANNEL_CANARY. In unbranded
83 // builds, or in branded builds when the channel cannot be determined, this
84 // will be CHANNEL_UNKNOWN.
85 Channel GetChannel();
86
87 // Returns true if the running browser can be set as the default browser. 60 // Returns true if the running browser can be set as the default browser.
88 bool CanSetAsDefaultBrowser(); 61 bool CanSetAsDefaultBrowser();
89 62
90 // Returns true if the running browser can be set as the default client 63 // Returns true if the running browser can be set as the default client
91 // application for the given protocol. 64 // application for the given protocol.
92 bool CanSetAsDefaultProtocolClient(const std::string& protocol); 65 bool CanSetAsDefaultProtocolClient(const std::string& protocol);
93 66
94 } 67 }
95 68
96 #endif // CHROME_BROWSER_PLATFORM_UTIL_H_ 69 #endif // CHROME_BROWSER_PLATFORM_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/browser/mac/keystone_glue.mm ('k') | chrome/browser/platform_util_common_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698