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

Side by Side Diff: chrome/browser/extensions/component_loader.cc

Issue 14200048: Introduce AcccessibilityManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
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/extensions/component_loader.h" 5 #include "chrome/browser/extensions/component_loader.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/json/json_string_value_serializer.h" 9 #include "base/json/json_string_value_serializer.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 15 matching lines...) Expand all
26 26
27 #if defined(USE_AURA) 27 #if defined(USE_AURA)
28 #include "grit/keyboard_resources.h" 28 #include "grit/keyboard_resources.h"
29 #endif 29 #endif
30 30
31 #if defined(GOOGLE_CHROME_BUILD) 31 #if defined(GOOGLE_CHROME_BUILD)
32 #include "chrome/browser/defaults.h" 32 #include "chrome/browser/defaults.h"
33 #endif 33 #endif
34 34
35 #if defined(OS_CHROMEOS) 35 #if defined(OS_CHROMEOS)
36 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
36 #include "chrome/browser/chromeos/login/user_manager.h" 37 #include "chrome/browser/chromeos/login/user_manager.h"
37 #include "chrome/browser/extensions/extension_service.h" 38 #include "chrome/browser/extensions/extension_service.h"
38 #include "chrome/browser/extensions/extension_system.h" 39 #include "chrome/browser/extensions/extension_system.h"
39 #include "chrome/browser/profiles/profile.h" 40 #include "chrome/browser/profiles/profile.h"
40 #include "chrome/browser/profiles/profile_manager.h" 41 #include "chrome/browser/profiles/profile_manager.h"
41 #include "chromeos/chromeos_switches.h" 42 #include "chromeos/chromeos_switches.h"
42 #include "content/public/browser/storage_partition.h" 43 #include "content/public/browser/storage_partition.h"
43 #include "webkit/browser/fileapi/file_system_context.h" 44 #include "webkit/browser/fileapi/file_system_context.h"
44 #include "webkit/browser/fileapi/sandbox_mount_point_provider.h" 45 #include "webkit/browser/fileapi/sandbox_mount_point_provider.h"
45 #endif 46 #endif
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 echo_extension_path = command_line->GetSwitchValuePath( 408 echo_extension_path = command_line->GetSwitchValuePath(
408 chromeos::switches::kEchoExtensionPath); 409 chromeos::switches::kEchoExtensionPath);
409 } 410 }
410 Add(IDR_ECHO_MANIFEST, echo_extension_path); 411 Add(IDR_ECHO_MANIFEST, echo_extension_path);
411 412
412 Add(IDR_NETWORK_CONFIGURATION_MANIFEST, 413 Add(IDR_NETWORK_CONFIGURATION_MANIFEST,
413 base::FilePath(FILE_PATH_LITERAL("chromeos/network_configuration"))); 414 base::FilePath(FILE_PATH_LITERAL("chromeos/network_configuration")));
414 } 415 }
415 416
416 // Load ChromeVox extension now if spoken feedback is enabled. 417 // Load ChromeVox extension now if spoken feedback is enabled.
417 if (local_state_->GetBoolean(prefs::kSpokenFeedbackEnabled)) { 418 if (chromeos::AccessibilityManager::Get() &&
419 chromeos::AccessibilityManager::Get()->IsSpokenFeedbackEnabled()) {
418 base::FilePath path = 420 base::FilePath path =
419 base::FilePath(extension_misc::kChromeVoxExtensionPath); 421 base::FilePath(extension_misc::kChromeVoxExtensionPath);
420 Add(IDR_CHROMEVOX_MANIFEST, path); 422 Add(IDR_CHROMEVOX_MANIFEST, path);
421 } 423 }
422 #endif // defined(OS_CHROMEOS) 424 #endif // defined(OS_CHROMEOS)
423 425
424 #if defined(ENABLE_GOOGLE_NOW) 426 #if defined(ENABLE_GOOGLE_NOW)
425 if (CommandLine::ForCurrentProcess()->HasSwitch( 427 if (CommandLine::ForCurrentProcess()->HasSwitch(
426 switches::kEnableGoogleNowIntegration)) { 428 switches::kEnableGoogleNowIntegration)) {
427 Add(IDR_GOOGLE_NOW_MANIFEST, 429 Add(IDR_GOOGLE_NOW_MANIFEST,
428 base::FilePath(FILE_PATH_LITERAL("google_now"))); 430 base::FilePath(FILE_PATH_LITERAL("google_now")));
429 } 431 }
430 #endif 432 #endif
431 } 433 }
432 434
433 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { 435 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) {
434 delete component->manifest; 436 delete component->manifest;
435 if (extension_service_->is_ready()) { 437 if (extension_service_->is_ready()) {
436 extension_service_-> 438 extension_service_->
437 UnloadExtension(component->extension_id, 439 UnloadExtension(component->extension_id,
438 extension_misc::UNLOAD_REASON_DISABLE); 440 extension_misc::UNLOAD_REASON_DISABLE);
439 } 441 }
440 } 442 }
441 443
442 } // namespace extensions 444 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698