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

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

Issue 17115013: Enable AutoImport for Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « no previous file | chrome/browser/first_run/first_run_browsertest.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) 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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 669
670 return DO_FIRST_RUN_TASKS; 670 return DO_FIRST_RUN_TASKS;
671 } 671 }
672 672
673 void AutoImport( 673 void AutoImport(
674 Profile* profile, 674 Profile* profile,
675 bool homepage_defined, 675 bool homepage_defined,
676 int import_items, 676 int import_items,
677 int dont_import_items, 677 int dont_import_items,
678 const std::string& import_bookmarks_path) { 678 const std::string& import_bookmarks_path) {
679 #if !defined(USE_AURA)
680 // Deletes itself. 679 // Deletes itself.
681 ImporterHost* importer_host; 680 ImporterHost* importer_host;
682 // TODO(csilv,mirandac): Out-of-process import has only been qualified on 681 // TODO(csilv,mirandac): Out-of-process import has only been qualified on
683 // MacOS X and Windows, so we will only use it on those platforms. 682 // MacOS X and Windows, so we will only use it on those platforms.
684 // Linux still uses the in-process import (http://crbug.com/56816). 683 // Linux still uses the in-process import (http://crbug.com/56816).
685 #if defined(OS_MACOSX) || defined(OS_WIN) 684 #if defined(OS_MACOSX) || defined(OS_WIN)
686 importer_host = new ExternalProcessImporterHost; 685 importer_host = new ExternalProcessImporterHost;
687 #else 686 #else
688 importer_host = new ImporterHost; 687 importer_host = new ImporterHost;
689 #endif 688 #endif
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 #else 760 #else
762 file_importer_host = new ImporterHost; 761 file_importer_host = new ImporterHost;
763 #endif 762 #endif
764 file_importer_host->set_headless(); 763 file_importer_host->set_headless();
765 764
766 ImportFromFile(profile, file_importer_host, import_bookmarks_path); 765 ImportFromFile(profile, file_importer_host, import_bookmarks_path);
767 } 766 }
768 767
769 content::RecordAction(UserMetricsAction("FirstRunDef_Accept")); 768 content::RecordAction(UserMetricsAction("FirstRunDef_Accept"));
770 769
771 #endif // !defined(USE_AURA)
772 g_auto_import_state |= AUTO_IMPORT_CALLED; 770 g_auto_import_state |= AUTO_IMPORT_CALLED;
773 } 771 }
774 772
775 void DoPostImportTasks(Profile* profile, bool make_chrome_default) { 773 void DoPostImportTasks(Profile* profile, bool make_chrome_default) {
776 if (make_chrome_default && 774 if (make_chrome_default &&
777 ShellIntegration::CanSetAsDefaultBrowser() == 775 ShellIntegration::CanSetAsDefaultBrowser() ==
778 ShellIntegration::SET_DEFAULT_UNATTENDED) { 776 ShellIntegration::SET_DEFAULT_UNATTENDED) {
779 ShellIntegration::SetAsDefaultBrowser(); 777 ShellIntegration::SetAsDefaultBrowser();
780 } 778 }
781 779
782 // Display the first run bubble if there is a default search provider. 780 // Display the first run bubble if there is a default search provider.
783 TemplateURLService* template_url = 781 TemplateURLService* template_url =
784 TemplateURLServiceFactory::GetForProfile(profile); 782 TemplateURLServiceFactory::GetForProfile(profile);
785 if (template_url && template_url->GetDefaultSearchProvider()) 783 if (template_url && template_url->GetDefaultSearchProvider())
786 FirstRunBubbleLauncher::ShowFirstRunBubbleSoon(); 784 FirstRunBubbleLauncher::ShowFirstRunBubbleSoon();
787 SetShouldShowWelcomePage(); 785 SetShouldShowWelcomePage();
788 SetShouldDoPersonalDataManagerFirstRun(); 786 SetShouldDoPersonalDataManagerFirstRun();
789 787
790 internal::DoPostImportPlatformSpecificTasks(profile); 788 internal::DoPostImportPlatformSpecificTasks(profile);
791 } 789 }
792 790
793 uint16 auto_import_state() { 791 uint16 auto_import_state() {
794 return g_auto_import_state; 792 return g_auto_import_state;
795 } 793 }
796 794
797 } // namespace first_run 795 } // namespace first_run
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/first_run/first_run_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698