diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-01 23:13:32 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-01 23:13:32 +0000 |
commit | 8313fef77dd4f51e2c96bc47e8a20c0601eb9312 (patch) | |
tree | c1de06f8518307f0af8131b33328da78df7344d4 /chrome/browser/first_run.cc | |
parent | cbc5da797407079b913d53a65f326083399b2088 (diff) | |
download | chromium_src-8313fef77dd4f51e2c96bc47e8a20c0601eb9312.zip chromium_src-8313fef77dd4f51e2c96bc47e8a20c0601eb9312.tar.gz chromium_src-8313fef77dd4f51e2c96bc47e8a20c0601eb9312.tar.bz2 |
If Chrome is not the default browser, tell the user, unless:
- it is the first run
- the user already said not to warn him/her about it
- an info-bar is already showing.
BUG=9049
TEST=Run a new install of chrome, proceed through the first run flow, don't
make Chrome your default browser. No info-bar warning about Chrome not
being the default browser should be shown.
Restart Chrome, such an info-bar should be shown. Click the x on the
info-bar to close it. Restart Chrome. The info-bar should be shown.
Select "Set as default". Restart Chrome, the info-bar should not be shown.
Start IE, make it your default browser (Tools menu, 'Internet option',
Programs tab). Restart Chrome, it should show the default browser info-bar.
Select "Don't ask me again". Restart Chrome, the info-bar should not be
shown.
Review URL: http://codereview.chromium.org/99301
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15115 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run.cc')
-rw-r--r-- | chrome/browser/first_run.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/chrome/browser/first_run.cc b/chrome/browser/first_run.cc index c402812..d14e0c1 100644 --- a/chrome/browser/first_run.cc +++ b/chrome/browser/first_run.cc @@ -154,11 +154,18 @@ bool WriteEULAtoTempFile(FilePath* eula_path) { } // namespace bool FirstRun::IsChromeFirstRun() { + // A troolean, 0 means not yet set, 1 means set to true, 2 set to false. + static int first_run = 0; + if (first_run != 0) + return first_run == 1; + std::wstring first_run_sentinel; - if (!GetFirstRunSentinelFilePath(&first_run_sentinel)) - return false; - if (file_util::PathExists(first_run_sentinel)) + if (!GetFirstRunSentinelFilePath(&first_run_sentinel) || + file_util::PathExists(first_run_sentinel)) { + first_run = 2; return false; + } + first_run = 1; return true; } |