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

Side by Side Diff: chrome/browser/first_run/first_run.cc

Issue 208393020: Fix the new First Run sentinel file path determination. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup. Created 6 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/first_run/first_run.h" 5 #include "chrome/browser/first_run/first_run.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 28 matching lines...) Expand all
39 #include "chrome/browser/signin/signin_manager_factory.h" 39 #include "chrome/browser/signin/signin_manager_factory.h"
40 #include "chrome/browser/signin/signin_promo.h" 40 #include "chrome/browser/signin/signin_promo.h"
41 #include "chrome/browser/signin/signin_tracker.h" 41 #include "chrome/browser/signin/signin_tracker.h"
42 #include "chrome/browser/ui/browser.h" 42 #include "chrome/browser/ui/browser.h"
43 #include "chrome/browser/ui/browser_finder.h" 43 #include "chrome/browser/ui/browser_finder.h"
44 #include "chrome/browser/ui/chrome_pages.h" 44 #include "chrome/browser/ui/chrome_pages.h"
45 #include "chrome/browser/ui/global_error/global_error_service.h" 45 #include "chrome/browser/ui/global_error/global_error_service.h"
46 #include "chrome/browser/ui/global_error/global_error_service_factory.h" 46 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
47 #include "chrome/browser/ui/tabs/tab_strip_model.h" 47 #include "chrome/browser/ui/tabs/tab_strip_model.h"
48 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" 48 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
49 #include "chrome/common/chrome_constants.h"
49 #include "chrome/common/chrome_paths.h" 50 #include "chrome/common/chrome_paths.h"
50 #include "chrome/common/chrome_switches.h" 51 #include "chrome/common/chrome_switches.h"
51 #include "chrome/common/pref_names.h" 52 #include "chrome/common/pref_names.h"
52 #include "chrome/common/url_constants.h" 53 #include "chrome/common/url_constants.h"
53 #include "chrome/installer/util/master_preferences.h" 54 #include "chrome/installer/util/master_preferences.h"
54 #include "chrome/installer/util/master_preferences_constants.h" 55 #include "chrome/installer/util/master_preferences_constants.h"
55 #include "chrome/installer/util/util_constants.h" 56 #include "chrome/installer/util/util_constants.h"
56 #include "components/user_prefs/pref_registry_syncable.h" 57 #include "components/user_prefs/pref_registry_syncable.h"
57 #include "content/public/browser/notification_observer.h" 58 #include "content/public/browser/notification_observer.h"
58 #include "content/public/browser/notification_registrar.h" 59 #include "content/public/browser/notification_registrar.h"
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 &out_prefs->suppress_default_browser_prompt_for_version); 566 &out_prefs->suppress_default_browser_prompt_for_version);
566 } 567 }
567 568
568 bool CreateSentinel() { 569 bool CreateSentinel() {
569 base::FilePath first_run_sentinel; 570 base::FilePath first_run_sentinel;
570 if (!internal::GetFirstRunSentinelFilePath(&first_run_sentinel)) 571 if (!internal::GetFirstRunSentinelFilePath(&first_run_sentinel))
571 return false; 572 return false;
572 return base::WriteFile(first_run_sentinel, "", 0) != -1; 573 return base::WriteFile(first_run_sentinel, "", 0) != -1;
573 } 574 }
574 575
576 bool GetFirstRunSentinelFilePath(base::FilePath* path) {
577 base::FilePath first_run_sentinel;
grt (UTC plus 2) 2014/03/25 17:37:06 first_run_sentinel -> user_data_dir
msw 2014/03/25 23:33:13 Done.
578 if (!PathService::Get(chrome::DIR_USER_DATA, &first_run_sentinel))
579 return false;
580
581 *path = first_run_sentinel.Append(chrome::kFirstRunSentinel);
582 return true;
583 }
584
575 // -- Platform-specific functions -- 585 // -- Platform-specific functions --
576 586
577 #if !defined(OS_LINUX) && !defined(OS_BSD) 587 #if !defined(OS_LINUX) && !defined(OS_BSD)
578 bool IsOrganicFirstRun() { 588 bool IsOrganicFirstRun() {
579 std::string brand; 589 std::string brand;
580 google_util::GetBrand(&brand); 590 google_util::GetBrand(&brand);
581 return google_util::IsOrganicFirstRun(brand); 591 return google_util::IsOrganicFirstRun(brand);
582 } 592 }
583 #endif 593 #endif
584 594
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 SetShouldDoPersonalDataManagerFirstRun(); 825 SetShouldDoPersonalDataManagerFirstRun();
816 826
817 internal::DoPostImportPlatformSpecificTasks(profile); 827 internal::DoPostImportPlatformSpecificTasks(profile);
818 } 828 }
819 829
820 uint16 auto_import_state() { 830 uint16 auto_import_state() {
821 return g_auto_import_state; 831 return g_auto_import_state;
822 } 832 }
823 833
824 } // namespace first_run 834 } // namespace first_run
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/first_run/first_run_internal.h » ('j') | chrome/installer/setup/install.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698