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

Side by Side Diff: chrome/browser/extensions/extension_service.h

Issue 10407105: Improve error messaging of webRequest API in case of conflicts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Store ExtensionWarnings as values in set rather than pointers Created 8 years, 3 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/file_path.h" 14 #include "base/file_path.h"
15 #include "base/gtest_prod_util.h" 15 #include "base/gtest_prod_util.h"
16 #include "base/memory/linked_ptr.h" 16 #include "base/memory/linked_ptr.h"
17 #include "base/memory/ref_counted.h" 17 #include "base/memory/ref_counted.h"
18 #include "base/memory/weak_ptr.h" 18 #include "base/memory/weak_ptr.h"
19 #include "base/string16.h" 19 #include "base/string16.h"
20 #include "base/time.h" 20 #include "base/time.h"
21 #include "base/tuple.h" 21 #include "base/tuple.h"
22 #include "chrome/browser/api/prefs/pref_change_registrar.h" 22 #include "chrome/browser/api/prefs/pref_change_registrar.h"
23 #include "chrome/browser/extensions/app_shortcut_manager.h" 23 #include "chrome/browser/extensions/app_shortcut_manager.h"
24 #include "chrome/browser/extensions/app_sync_bundle.h" 24 #include "chrome/browser/extensions/app_sync_bundle.h"
25 #include "chrome/browser/extensions/extension_icon_manager.h" 25 #include "chrome/browser/extensions/extension_icon_manager.h"
26 #include "chrome/browser/extensions/extension_prefs.h" 26 #include "chrome/browser/extensions/extension_prefs.h"
27 #include "chrome/browser/extensions/extension_process_manager.h" 27 #include "chrome/browser/extensions/extension_process_manager.h"
28 #include "chrome/browser/extensions/extension_sync_bundle.h" 28 #include "chrome/browser/extensions/extension_sync_bundle.h"
29 #include "chrome/browser/extensions/extension_toolbar_model.h" 29 #include "chrome/browser/extensions/extension_toolbar_model.h"
30 #include "chrome/browser/extensions/extension_warning_set.h"
31 #include "chrome/browser/extensions/extensions_quota_service.h" 30 #include "chrome/browser/extensions/extensions_quota_service.h"
32 #include "chrome/browser/extensions/external_provider_interface.h" 31 #include "chrome/browser/extensions/external_provider_interface.h"
33 #include "chrome/browser/extensions/menu_manager.h" 32 #include "chrome/browser/extensions/menu_manager.h"
34 #include "chrome/browser/extensions/pending_extension_manager.h" 33 #include "chrome/browser/extensions/pending_extension_manager.h"
35 #include "chrome/browser/extensions/process_map.h" 34 #include "chrome/browser/extensions/process_map.h"
36 #include "chrome/common/extensions/extension.h" 35 #include "chrome/common/extensions/extension.h"
37 #include "chrome/common/extensions/extension_constants.h" 36 #include "chrome/common/extensions/extension_constants.h"
38 #include "chrome/common/extensions/extension_set.h" 37 #include "chrome/common/extensions/extension_set.h"
39 #include "content/public/browser/browser_thread.h" 38 #include "content/public/browser/browser_thread.h"
40 #include "content/public/browser/notification_observer.h" 39 #include "content/public/browser/notification_observer.h"
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 // need to be made more efficient. 613 // need to be made more efficient.
615 static void RecordPermissionMessagesHistogram( 614 static void RecordPermissionMessagesHistogram(
616 const extensions::Extension* e, const char* histogram); 615 const extensions::Extension* e, const char* histogram);
617 616
618 #if defined(UNIT_TEST) 617 #if defined(UNIT_TEST)
619 void TrackTerminatedExtensionForTest(const extensions::Extension* extension) { 618 void TrackTerminatedExtensionForTest(const extensions::Extension* extension) {
620 TrackTerminatedExtension(extension); 619 TrackTerminatedExtension(extension);
621 } 620 }
622 #endif 621 #endif
623 622
624 ExtensionWarningSet* extension_warnings() {
625 return &extension_warnings_;
626 }
627
628 extensions::AppShortcutManager* app_shortcut_manager() { 623 extensions::AppShortcutManager* app_shortcut_manager() {
629 return &app_shortcut_manager_; 624 return &app_shortcut_manager_;
630 } 625 }
631 626
632 // Specialization of syncer::SyncableService::AsWeakPtr. 627 // Specialization of syncer::SyncableService::AsWeakPtr.
633 base::WeakPtr<ExtensionService> AsWeakPtr() { return base::AsWeakPtr(this); } 628 base::WeakPtr<ExtensionService> AsWeakPtr() { return base::AsWeakPtr(this); }
634 629
635 private: 630 private:
636 // Contains Extension data that can change during the life of the process, 631 // Contains Extension data that can change during the life of the process,
637 // but does not persist across restarts. 632 // but does not persist across restarts.
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 // has to wait for the external providers. Used in 853 // has to wait for the external providers. Used in
859 // OnAllExternalProvidersReady() to determine if an update check is needed to 854 // OnAllExternalProvidersReady() to determine if an update check is needed to
860 // install pending extensions. 855 // install pending extensions.
861 bool update_once_all_providers_are_ready_; 856 bool update_once_all_providers_are_ready_;
862 857
863 NaClModuleInfoList nacl_module_list_; 858 NaClModuleInfoList nacl_module_list_;
864 859
865 extensions::AppSyncBundle app_sync_bundle_; 860 extensions::AppSyncBundle app_sync_bundle_;
866 extensions::ExtensionSyncBundle extension_sync_bundle_; 861 extensions::ExtensionSyncBundle extension_sync_bundle_;
867 862
868 // Contains an entry for each warning that shall be currently shown.
869 ExtensionWarningSet extension_warnings_;
870
871 extensions::ProcessMap process_map_; 863 extensions::ProcessMap process_map_;
872 864
873 extensions::AppShortcutManager app_shortcut_manager_; 865 extensions::AppShortcutManager app_shortcut_manager_;
874 866
875 scoped_ptr<ExtensionErrorUI> extension_error_ui_; 867 scoped_ptr<ExtensionErrorUI> extension_error_ui_;
876 868
877 #if defined(ENABLE_EXTENSIONS) 869 #if defined(ENABLE_EXTENSIONS)
878 scoped_ptr<extensions::ExtensionActionStorageManager> 870 scoped_ptr<extensions::ExtensionActionStorageManager>
879 extension_action_storage_manager_; 871 extension_action_storage_manager_;
880 #endif 872 #endif
881 873
882 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 874 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
883 InstallAppsWithUnlimtedStorage); 875 InstallAppsWithUnlimtedStorage);
884 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 876 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
885 InstallAppsAndCheckStorageProtection); 877 InstallAppsAndCheckStorageProtection);
886 DISALLOW_COPY_AND_ASSIGN(ExtensionService); 878 DISALLOW_COPY_AND_ASSIGN(ExtensionService);
887 }; 879 };
888 880
889 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 881 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698