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

Side by Side Diff: third_party/WebKit/Source/core/page/ContextMenuController.cpp

Issue 2858963002: Replace ASSERT with DCHECK in core/ (Closed)
Patch Set: WorkerBackingThread Created 3 years, 7 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 /* 1 /*
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Igalia S.L 3 * Copyright (C) 2010 Igalia S.L
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 ClearContextMenu(); 126 ClearContextMenu();
127 return; 127 return;
128 } 128 }
129 129
130 menu_provider_->PopulateContextMenu(context_menu_.get()); 130 menu_provider_->PopulateContextMenu(context_menu_.get());
131 ShowContextMenu(nullptr); 131 ShowContextMenu(nullptr);
132 } 132 }
133 133
134 std::unique_ptr<ContextMenu> ContextMenuController::CreateContextMenu( 134 std::unique_ptr<ContextMenu> ContextMenuController::CreateContextMenu(
135 Event* event) { 135 Event* event) {
136 ASSERT(event); 136 DCHECK(event);
137 137
138 if (!event->IsMouseEvent()) 138 if (!event->IsMouseEvent())
139 return nullptr; 139 return nullptr;
140 140
141 MouseEvent* mouse_event = ToMouseEvent(event); 141 MouseEvent* mouse_event = ToMouseEvent(event);
142 return CreateContextMenu(event->target()->ToNode()->GetDocument().GetFrame(), 142 return CreateContextMenu(event->target()->ToNode()->GetDocument().GetFrame(),
143 LayoutPoint(mouse_event->AbsoluteLocation())); 143 LayoutPoint(mouse_event->AbsoluteLocation()));
144 } 144 }
145 145
146 std::unique_ptr<ContextMenu> ContextMenuController::CreateContextMenu( 146 std::unique_ptr<ContextMenu> ContextMenuController::CreateContextMenu(
(...skipping 27 matching lines...) Expand all
174 174
175 void ContextMenuController::ContextMenuItemSelected( 175 void ContextMenuController::ContextMenuItemSelected(
176 const ContextMenuItem* item) { 176 const ContextMenuItem* item) {
177 ASSERT(item->GetType() == kActionType || 177 ASSERT(item->GetType() == kActionType ||
178 item->GetType() == kCheckableActionType); 178 item->GetType() == kCheckableActionType);
179 179
180 if (item->Action() < kContextMenuItemBaseCustomTag || 180 if (item->Action() < kContextMenuItemBaseCustomTag ||
181 item->Action() > kContextMenuItemLastCustomTag) 181 item->Action() > kContextMenuItemLastCustomTag)
182 return; 182 return;
183 183
184 ASSERT(menu_provider_); 184 DCHECK(menu_provider_);
185 menu_provider_->ContextMenuItemSelected(item); 185 menu_provider_->ContextMenuItemSelected(item);
186 } 186 }
187 187
188 } // namespace blink 188 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/ChromeClient.cpp ('k') | third_party/WebKit/Source/core/page/CreateWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698