OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/profiles/profile_impl.h" | 5 #include "chrome/browser/profiles/profile_impl.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/environment.h" | 9 #include "base/environment.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 GetChromeURLDataManager()->AddDataSource(new ExtensionIconSource(this)); | 498 GetChromeURLDataManager()->AddDataSource(new ExtensionIconSource(this)); |
499 | 499 |
500 // Initialize extension event routers. Note that on Chrome OS, this will | 500 // Initialize extension event routers. Note that on Chrome OS, this will |
501 // not succeed if the user has not logged in yet, in which case the | 501 // not succeed if the user has not logged in yet, in which case the |
502 // event routers are initialized in LoginUtilsImpl::CompleteLogin instead. | 502 // event routers are initialized in LoginUtilsImpl::CompleteLogin instead. |
503 // The InitEventRouters call used to be in BrowserMain, because when bookmark | 503 // The InitEventRouters call used to be in BrowserMain, because when bookmark |
504 // import happened on first run, the bookmark bar was not being correctly | 504 // import happened on first run, the bookmark bar was not being correctly |
505 // initialized (see issue 40144). Now that bookmarks aren't imported and | 505 // initialized (see issue 40144). Now that bookmarks aren't imported and |
506 // the event routers need to be initialized for every profile individually, | 506 // the event routers need to be initialized for every profile individually, |
507 // initialize them with the extension service. | 507 // initialize them with the extension service. |
508 extension_service_->InitEventRouters(); | 508 // If this profile is being created as part of the import process, never |
| 509 // initialize the event routers. If import is going to run in a separate |
| 510 // process (the profile itself is on the main process), wait for import to |
| 511 // finish before initializing the routers. |
| 512 if (!command_line->HasSwitch(switches::kImport) && |
| 513 !command_line->HasSwitch(switches::kImportFromFile)) { |
| 514 if (g_browser_process->profile_manager()->will_import()) { |
| 515 extension_service_->InitEventRoutersAfterImport(); |
| 516 } else { |
| 517 extension_service_->InitEventRouters(); |
| 518 } |
| 519 } |
509 } | 520 } |
510 | 521 |
511 void ProfileImpl::RegisterComponentExtensions() { | 522 void ProfileImpl::RegisterComponentExtensions() { |
512 // Register the component extensions. | 523 // Register the component extensions. |
513 // | 524 // |
514 // Component extension manifest must contain a 'key' property with a unique | 525 // Component extension manifest must contain a 'key' property with a unique |
515 // public key, serialized in base64. You can create a suitable value with the | 526 // public key, serialized in base64. You can create a suitable value with the |
516 // following commands on a unixy system: | 527 // following commands on a unixy system: |
517 // | 528 // |
518 // ssh-keygen -t rsa -b 1024 -N '' -f /tmp/key.pem | 529 // ssh-keygen -t rsa -b 1024 -N '' -f /tmp/key.pem |
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1721 #endif | 1732 #endif |
1722 } | 1733 } |
1723 return prerender_manager_.get(); | 1734 return prerender_manager_.get(); |
1724 } | 1735 } |
1725 | 1736 |
1726 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { | 1737 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { |
1727 if (!spellcheck_profile_.get()) | 1738 if (!spellcheck_profile_.get()) |
1728 spellcheck_profile_.reset(new SpellCheckProfile()); | 1739 spellcheck_profile_.reset(new SpellCheckProfile()); |
1729 return spellcheck_profile_.get(); | 1740 return spellcheck_profile_.get(); |
1730 } | 1741 } |
OLD | NEW |