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 "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
374 } | 374 } |
375 | 375 |
376 void ProfileImpl::RegisterComponentExtensions() { | 376 void ProfileImpl::RegisterComponentExtensions() { |
377 // Register the component extensions. | 377 // Register the component extensions. |
378 typedef std::list<std::pair<std::string, int> > ComponentExtensionList; | 378 typedef std::list<std::pair<std::string, int> > ComponentExtensionList; |
379 ComponentExtensionList component_extensions; | 379 ComponentExtensionList component_extensions; |
380 | 380 |
381 // Bookmark manager. | 381 // Bookmark manager. |
382 component_extensions.push_back( | 382 component_extensions.push_back( |
383 std::make_pair("bookmark_manager", IDR_BOOKMARKS_MANIFEST)); | 383 std::make_pair("bookmark_manager", IDR_BOOKMARKS_MANIFEST)); |
384 #if defined(OS_CHROMEOS) | |
385 // Register access extensions only if accessibility is enabled. | |
386 if (g_browser_process->local_state()-> | |
asargent_no_longer_on_chrome
2011/01/21 05:53:44
nit: I think you can just call GetPrefs() instead
| |
387 GetBoolean(prefs::kAccessibilityEnabled)) { | |
asargent_no_longer_on_chrome
2011/01/21 05:53:44
Looks like this current patch set is missing the c
| |
388 component_extensions.push_back( | |
389 std::make_pair("access_chromevox", IDR_CHROMEVOX_MANIFEST)); | |
390 } | |
391 #endif | |
384 | 392 |
385 #if defined(TOUCH_UI) | 393 #if defined(TOUCH_UI) |
386 component_extensions.push_back( | 394 component_extensions.push_back( |
387 std::make_pair("keyboard", IDR_KEYBOARD_MANIFEST)); | 395 std::make_pair("keyboard", IDR_KEYBOARD_MANIFEST)); |
388 #endif | 396 #endif |
389 | 397 |
390 // Web Store. | 398 // Web Store. |
391 component_extensions.push_back( | 399 component_extensions.push_back( |
392 std::make_pair("web_store", IDR_WEBSTORE_MANIFEST)); | 400 std::make_pair("web_store", IDR_WEBSTORE_MANIFEST)); |
393 | 401 |
394 for (ComponentExtensionList::iterator iter = component_extensions.begin(); | 402 for (ComponentExtensionList::iterator iter = component_extensions.begin(); |
395 iter != component_extensions.end(); ++iter) { | 403 iter != component_extensions.end(); ++iter) { |
396 FilePath path; | 404 FilePath path; |
397 if (PathService::Get(chrome::DIR_RESOURCES, &path)) { | 405 if (PathService::Get(chrome::DIR_RESOURCES, &path)) { |
398 path = path.AppendASCII(iter->first); | 406 path = path.AppendASCII(iter->first); |
399 } else { | 407 } else { |
400 NOTREACHED(); | 408 NOTREACHED(); |
401 } | 409 } |
402 | 410 |
411 #if defined(OS_CHROMEOS) | |
412 if (StartsWithASCII(iter->first, "access_", true)) { | |
asargent_no_longer_on_chrome
2011/01/21 05:53:44
Here's an idea - instead of pushing the ("access_c
Chaitanya
2011/01/21 20:09:32
Done.
| |
413 path = FilePath().AppendASCII(extension_misc::kAccessExtensionPath) | |
414 .AppendASCII(iter->first); | |
415 } | |
416 #endif | |
417 | |
403 std::string manifest = | 418 std::string manifest = |
404 ResourceBundle::GetSharedInstance().GetRawDataResource( | 419 ResourceBundle::GetSharedInstance().GetRawDataResource( |
405 iter->second).as_string(); | 420 iter->second).as_string(); |
406 extensions_service_->register_component_extension( | 421 extensions_service_->register_component_extension( |
407 ExtensionService::ComponentExtensionInfo(manifest, path)); | 422 ExtensionService::ComponentExtensionInfo(manifest, path)); |
408 } | 423 } |
409 } | 424 } |
410 | 425 |
411 void ProfileImpl::InstallDefaultApps() { | 426 void ProfileImpl::InstallDefaultApps() { |
412 ExtensionService* extension_service = GetExtensionService(); | 427 ExtensionService* extension_service = GetExtensionService(); |
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1389 } | 1404 } |
1390 | 1405 |
1391 PrerenderManager* ProfileImpl::GetPrerenderManager() { | 1406 PrerenderManager* ProfileImpl::GetPrerenderManager() { |
1392 CommandLine* cl = CommandLine::ForCurrentProcess(); | 1407 CommandLine* cl = CommandLine::ForCurrentProcess(); |
1393 if (!cl->HasSwitch(switches::kEnablePagePrerender)) | 1408 if (!cl->HasSwitch(switches::kEnablePagePrerender)) |
1394 return NULL; | 1409 return NULL; |
1395 if (!prerender_manager_) | 1410 if (!prerender_manager_) |
1396 prerender_manager_ = new PrerenderManager(this); | 1411 prerender_manager_ = new PrerenderManager(this); |
1397 return prerender_manager_; | 1412 return prerender_manager_; |
1398 } | 1413 } |
OLD | NEW |