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

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

Issue 6749021: Added new fileBrowserPrivate and fileHandler extension APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/extension_context_menu_api.h" 5 #include "chrome/browser/extensions/extension_context_menu_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } else if (value == "link") { 58 } else if (value == "link") {
59 tmp_result.Add(ExtensionMenuItem::LINK); 59 tmp_result.Add(ExtensionMenuItem::LINK);
60 } else if (value == "editable") { 60 } else if (value == "editable") {
61 tmp_result.Add(ExtensionMenuItem::EDITABLE); 61 tmp_result.Add(ExtensionMenuItem::EDITABLE);
62 } else if (value == "image") { 62 } else if (value == "image") {
63 tmp_result.Add(ExtensionMenuItem::IMAGE); 63 tmp_result.Add(ExtensionMenuItem::IMAGE);
64 } else if (value == "video") { 64 } else if (value == "video") {
65 tmp_result.Add(ExtensionMenuItem::VIDEO); 65 tmp_result.Add(ExtensionMenuItem::VIDEO);
66 } else if (value == "audio") { 66 } else if (value == "audio") {
67 tmp_result.Add(ExtensionMenuItem::AUDIO); 67 tmp_result.Add(ExtensionMenuItem::AUDIO);
68 } else if (value == "file") {
69 tmp_result.Add(ExtensionMenuItem::FILE);
68 } else { 70 } else {
69 error_ = ExtensionErrorUtils::FormatErrorMessage(kInvalidValueError, key); 71 error_ = ExtensionErrorUtils::FormatErrorMessage(kInvalidValueError, key);
70 return false; 72 return false;
71 } 73 }
72 } 74 }
73 *result = tmp_result; 75 *result = tmp_result;
74 return true; 76 return true;
75 } 77 }
76 78
77 bool ExtensionContextMenuFunction::ParseType( 79 bool ExtensionContextMenuFunction::ParseType(
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 352
351 return manager->RemoveContextMenuItem(id); 353 return manager->RemoveContextMenuItem(id);
352 } 354 }
353 355
354 bool RemoveAllContextMenusFunction::RunImpl() { 356 bool RemoveAllContextMenusFunction::RunImpl() {
355 ExtensionService* service = profile()->GetExtensionService(); 357 ExtensionService* service = profile()->GetExtensionService();
356 ExtensionMenuManager* manager = service->menu_manager(); 358 ExtensionMenuManager* manager = service->menu_manager();
357 manager->RemoveAllContextItems(extension_id()); 359 manager->RemoveAllContextItems(extension_id());
358 return true; 360 return true;
359 } 361 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698