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

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

Issue 2937623002: [Extensions] Simplify EventFilteringInfo (Closed)
Patch Set: karan's Created 3 years, 6 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/menu_manager.h" 5 #include "chrome/browser/extensions/menu_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <tuple> 9 #include <tuple>
10 #include <utility> 10 #include <utility>
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 { 726 {
727 // Dispatch to .contextMenus.onClicked handler. 727 // Dispatch to .contextMenus.onClicked handler.
728 auto event = base::MakeUnique<Event>( 728 auto event = base::MakeUnique<Event>(
729 webview_guest ? events::CHROME_WEB_VIEW_INTERNAL_ON_CLICKED 729 webview_guest ? events::CHROME_WEB_VIEW_INTERNAL_ON_CLICKED
730 : events::CONTEXT_MENUS_ON_CLICKED, 730 : events::CONTEXT_MENUS_ON_CLICKED,
731 webview_guest ? api::chrome_web_view_internal::OnClicked::kEventName 731 webview_guest ? api::chrome_web_view_internal::OnClicked::kEventName
732 : api::context_menus::OnClicked::kEventName, 732 : api::context_menus::OnClicked::kEventName,
733 std::move(args), context); 733 std::move(args), context);
734 event->user_gesture = EventRouter::USER_GESTURE_ENABLED; 734 event->user_gesture = EventRouter::USER_GESTURE_ENABLED;
735 if (webview_guest) 735 if (webview_guest)
736 event->filter_info.SetInstanceID(webview_guest->view_instance_id()); 736 event->filter_info.instance_id = webview_guest->view_instance_id();
737 event_router->DispatchEventToExtension(item->extension_id(), 737 event_router->DispatchEventToExtension(item->extension_id(),
738 std::move(event)); 738 std::move(event));
739 } 739 }
740 } 740 }
741 741
742 void MenuManager::SanitizeRadioList(const MenuItem::OwnedList& item_list) { 742 void MenuManager::SanitizeRadioList(const MenuItem::OwnedList& item_list) {
743 auto i = item_list.begin(); 743 auto i = item_list.begin();
744 while (i != item_list.end()) { 744 while (i != item_list.end()) {
745 if ((*i)->type() != MenuItem::RADIO) { 745 if ((*i)->type() != MenuItem::RADIO) {
746 ++i; 746 ++i;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 bool MenuItem::Id::operator!=(const Id& other) const { 966 bool MenuItem::Id::operator!=(const Id& other) const {
967 return !(*this == other); 967 return !(*this == other);
968 } 968 }
969 969
970 bool MenuItem::Id::operator<(const Id& other) const { 970 bool MenuItem::Id::operator<(const Id& other) const {
971 return std::tie(incognito, extension_key, uid, string_uid) < 971 return std::tie(incognito, extension_key, uid, string_uid) <
972 std::tie(other.incognito, other.extension_key, other.uid, other.string_uid); 972 std::tie(other.incognito, other.extension_key, other.uid, other.string_uid);
973 } 973 }
974 974
975 } // namespace extensions 975 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698