| OLD | NEW |
| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 local_state->SetBoolean(prefs::kAutofillPersonalDataManagerFirstRun, true); | 554 local_state->SetBoolean(prefs::kAutofillPersonalDataManagerFirstRun, true); |
| 555 } | 555 } |
| 556 return true; | 556 return true; |
| 557 } | 557 } |
| 558 | 558 |
| 559 void LogFirstRunMetric(FirstRunBubbleMetric metric) { | 559 void LogFirstRunMetric(FirstRunBubbleMetric metric) { |
| 560 UMA_HISTOGRAM_ENUMERATION("FirstRun.SearchEngineBubble", metric, | 560 UMA_HISTOGRAM_ENUMERATION("FirstRun.SearchEngineBubble", metric, |
| 561 NUM_FIRST_RUN_BUBBLE_METRICS); | 561 NUM_FIRST_RUN_BUBBLE_METRICS); |
| 562 } | 562 } |
| 563 | 563 |
| 564 namespace { |
| 565 CommandLine* GetExtraArgumentsInstance() { |
| 566 CR_DEFINE_STATIC_LOCAL(CommandLine, arguments, (CommandLine::NoProgram())); |
| 567 return &arguments; |
| 568 } |
| 569 } // namespace |
| 570 |
| 571 void SetExtraArgumentsForImportProcess(const CommandLine& arguments) { |
| 572 GetExtraArgumentsInstance()->AppendArguments(arguments, false); |
| 573 } |
| 574 |
| 575 const CommandLine& GetExtraArgumentsForImportProcess() { |
| 576 return *GetExtraArgumentsInstance(); |
| 577 } |
| 578 |
| 564 // static | 579 // static |
| 565 void FirstRunBubbleLauncher::ShowFirstRunBubbleSoon() { | 580 void FirstRunBubbleLauncher::ShowFirstRunBubbleSoon() { |
| 566 SetShowFirstRunBubblePref(true); | 581 SetShowFirstRunBubblePref(true); |
| 567 // This FirstRunBubbleLauncher instance will manage its own lifetime. | 582 // This FirstRunBubbleLauncher instance will manage its own lifetime. |
| 568 new FirstRunBubbleLauncher(); | 583 new FirstRunBubbleLauncher(); |
| 569 } | 584 } |
| 570 | 585 |
| 571 FirstRunBubbleLauncher::FirstRunBubbleLauncher() { | 586 FirstRunBubbleLauncher::FirstRunBubbleLauncher() { |
| 572 registrar_.Add(this, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, | 587 registrar_.Add(this, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
| 573 content::NotificationService::AllSources()); | 588 content::NotificationService::AllSources()); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 return SKIP_FIRST_RUN; | 698 return SKIP_FIRST_RUN; |
| 684 | 699 |
| 685 internal::SetShowWelcomePagePrefIfNeeded(install_prefs.get()); | 700 internal::SetShowWelcomePagePrefIfNeeded(install_prefs.get()); |
| 686 internal::SetImportPreferencesAndLaunchImport(out_prefs, install_prefs.get()); | 701 internal::SetImportPreferencesAndLaunchImport(out_prefs, install_prefs.get()); |
| 687 internal::SetDefaultBrowser(install_prefs.get()); | 702 internal::SetDefaultBrowser(install_prefs.get()); |
| 688 | 703 |
| 689 return SKIP_FIRST_RUN; | 704 return SKIP_FIRST_RUN; |
| 690 } | 705 } |
| 691 | 706 |
| 692 } // namespace first_run | 707 } // namespace first_run |
| OLD | NEW |