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

Side by Side Diff: chrome/browser/extensions/api/context_menus/context_menus_api_helpers.cc

Issue 359493005: Extend contextMenus API to support browser/page actions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_helpers. h" 5 #include "chrome/browser/extensions/api/context_menus/context_menus_api_helpers. h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 8
9 namespace extensions { 9 namespace extensions {
10 namespace context_menus_api_helpers { 10 namespace context_menus_api_helpers {
11 11
12 const char kActionNotAllowedError[] =
13 "Only extensions are allowed to use action contexts";
12 const char kCannotFindItemError[] = "Cannot find menu item with id *"; 14 const char kCannotFindItemError[] = "Cannot find menu item with id *";
13 const char kCheckedError[] = 15 const char kCheckedError[] =
14 "Only items with type \"radio\" or \"checkbox\" can be checked"; 16 "Only items with type \"radio\" or \"checkbox\" can be checked";
15 const char kDuplicateIDError[] = 17 const char kDuplicateIDError[] =
16 "Cannot create item with duplicate id *"; 18 "Cannot create item with duplicate id *";
17 const char kGeneratedIdKey[] = "generatedId"; 19 const char kGeneratedIdKey[] = "generatedId";
18 const char kLauncherNotAllowedError[] = 20 const char kLauncherNotAllowedError[] =
19 "Only packaged apps are allowed to use 'launcher' context"; 21 "Only packaged apps are allowed to use 'launcher' context";
20 const char kOnclickDisallowedError[] = "Extensions using event pages cannot " 22 const char kOnclickDisallowedError[] = "Extensions using event pages cannot "
21 "pass an onclick parameter to chrome.contextMenus.create. Instead, use " 23 "pass an onclick parameter to chrome.contextMenus.create. Instead, use "
(...skipping 22 matching lines...) Expand all
44 } 46 }
45 if (parent->type() != MenuItem::NORMAL) { 47 if (parent->type() != MenuItem::NORMAL) {
46 *error = kParentsMustBeNormalError; 48 *error = kParentsMustBeNormalError;
47 return NULL; 49 return NULL;
48 } 50 }
49 return parent; 51 return parent;
50 } 52 }
51 53
52 } // namespace context_menus_api_helpers 54 } // namespace context_menus_api_helpers
53 } // namespace extensions 55 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698