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

Unified Diff: chrome/browser/first_run.cc

Issue 155168: Fix for the default browser info-bar showing after first run (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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/browser/first_run.h ('k') | chrome/browser/first_run_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/first_run.cc
===================================================================
--- chrome/browser/first_run.cc (revision 20029)
+++ chrome/browser/first_run.cc (working copy)
@@ -58,9 +58,19 @@
// TODO(port): Mac should share this code.
#if !defined(OS_MACOSX)
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;
+
FilePath first_run_sentinel;
- return (GetFirstRunSentinelFilePath(&first_run_sentinel) &&
- !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;
}
#endif
« no previous file with comments | « chrome/browser/first_run.h ('k') | chrome/browser/first_run_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698