OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <atlbase.h> | 5 #include <atlbase.h> |
6 #include <atlcom.h> | 6 #include <atlcom.h> |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shlobj.h> | 8 #include <shlobj.h> |
9 | 9 |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 284 |
285 int import_items = 0; | 285 int import_items = 0; |
286 if (parse_result & installer_util::MASTER_PROFILE_IMPORT_SEARCH_ENGINE) | 286 if (parse_result & installer_util::MASTER_PROFILE_IMPORT_SEARCH_ENGINE) |
287 import_items += SEARCH_ENGINES; | 287 import_items += SEARCH_ENGINES; |
288 if (parse_result & installer_util::MASTER_PROFILE_IMPORT_HISTORY) | 288 if (parse_result & installer_util::MASTER_PROFILE_IMPORT_HISTORY) |
289 import_items += HISTORY; | 289 import_items += HISTORY; |
290 | 290 |
291 if (import_items) { | 291 if (import_items) { |
292 // There is something to import from the default browser. This launches | 292 // There is something to import from the default browser. This launches |
293 // the importer process and blocks until done or until it fails. | 293 // the importer process and blocks until done or until it fails. |
294 ImporterHost importer_host; | 294 scoped_refptr<ImporterHost> importer_host = new ImporterHost(); |
295 if (!FirstRun::ImportSettings(NULL, | 295 if (!FirstRun::ImportSettings(NULL, |
296 importer_host.GetSourceProfileInfoAt(0).browser_type, | 296 importer_host->GetSourceProfileInfoAt(0).browser_type, |
297 import_items, NULL)) { | 297 import_items, NULL)) { |
298 LOG(WARNING) << "silent import failed"; | 298 LOG(WARNING) << "silent import failed"; |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 return false; | 302 return false; |
303 } | 303 } |
304 | 304 |
305 bool Upgrade::IsBrowserAlreadyRunning() { | 305 bool Upgrade::IsBrowserAlreadyRunning() { |
306 static HANDLE handle = NULL; | 306 static HANDLE handle = NULL; |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 bool FirstRun::SetShowWelcomePagePref() { | 612 bool FirstRun::SetShowWelcomePagePref() { |
613 PrefService* local_state = g_browser_process->local_state(); | 613 PrefService* local_state = g_browser_process->local_state(); |
614 if (!local_state) | 614 if (!local_state) |
615 return false; | 615 return false; |
616 if (!local_state->IsPrefRegistered(prefs::kShouldShowWelcomePage)) { | 616 if (!local_state->IsPrefRegistered(prefs::kShouldShowWelcomePage)) { |
617 local_state->RegisterBooleanPref(prefs::kShouldShowWelcomePage, false); | 617 local_state->RegisterBooleanPref(prefs::kShouldShowWelcomePage, false); |
618 local_state->SetBoolean(prefs::kShouldShowWelcomePage, true); | 618 local_state->SetBoolean(prefs::kShouldShowWelcomePage, true); |
619 } | 619 } |
620 return true; | 620 return true; |
621 } | 621 } |
OLD | NEW |