OLD | NEW |
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/api/context_menus/context_menus_api.h" | 5 #include "chrome/browser/extensions/api/context_menus/context_menus_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/browser/extensions/extension_service.h" | 12 #include "chrome/browser/extensions/extension_service.h" |
13 #include "chrome/browser/extensions/menu_manager.h" | 13 #include "chrome/browser/extensions/menu_manager.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/common/extensions/api/context_menus.h" | 15 #include "chrome/common/extensions/api/context_menus.h" |
16 #include "chrome/common/extensions/background_info.h" | |
17 #include "extensions/common/error_utils.h" | 16 #include "extensions/common/error_utils.h" |
| 17 #include "extensions/common/manifest_handlers/background_info.h" |
18 #include "extensions/common/url_pattern_set.h" | 18 #include "extensions/common/url_pattern_set.h" |
19 | 19 |
20 using extensions::ErrorUtils; | 20 using extensions::ErrorUtils; |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 const char kGeneratedIdKey[] = "generatedId"; | 24 const char kGeneratedIdKey[] = "generatedId"; |
25 | 25 |
26 const char kCannotFindItemError[] = "Cannot find menu item with id *"; | 26 const char kCannotFindItemError[] = "Cannot find menu item with id *"; |
27 const char kOnclickDisallowedError[] = "Extensions using event pages cannot " | 27 const char kOnclickDisallowedError[] = "Extensions using event pages cannot " |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 | 384 |
385 bool ContextMenusRemoveAllFunction::RunImpl() { | 385 bool ContextMenusRemoveAllFunction::RunImpl() { |
386 ExtensionService* service = GetProfile()->GetExtensionService(); | 386 ExtensionService* service = GetProfile()->GetExtensionService(); |
387 MenuManager* manager = service->menu_manager(); | 387 MenuManager* manager = service->menu_manager(); |
388 manager->RemoveAllContextItems(GetExtension()->id()); | 388 manager->RemoveAllContextItems(GetExtension()->id()); |
389 manager->WriteToStorage(GetExtension()); | 389 manager->WriteToStorage(GetExtension()); |
390 return true; | 390 return true; |
391 } | 391 } |
392 | 392 |
393 } // namespace extensions | 393 } // namespace extensions |
OLD | NEW |