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

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

Issue 186213003: <webview>: Context menu API implementation CL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make {extension_id,webview_instance_id} key for MenuManager items. Created 6 years, 9 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 (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_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 96
97 if (!manager->RemoveContextMenuItem(id)) 97 if (!manager->RemoveContextMenuItem(id))
98 return false; 98 return false;
99 manager->WriteToStorage(GetExtension()); 99 manager->WriteToStorage(GetExtension());
100 return true; 100 return true;
101 } 101 }
102 102
103 bool ContextMenusRemoveAllFunction::RunImpl() { 103 bool ContextMenusRemoveAllFunction::RunImpl() {
104 MenuManager* manager = MenuManager::Get(GetProfile()); 104 MenuManager* manager = MenuManager::Get(GetProfile());
105 manager->RemoveAllContextItems(GetExtension()->id()); 105 manager->RemoveAllContextItems(MenuItem::ExtensionKey(GetExtension()->id()));
106 manager->WriteToStorage(GetExtension()); 106 manager->WriteToStorage(GetExtension());
107 return true; 107 return true;
108 } 108 }
109 109
110 } // namespace extensions 110 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698