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

Unified Diff: chrome/browser/renderer_context_menu/render_view_context_menu_browsertest_util.cc

Issue 2063863002: Use DCHECKs when observing only a single notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_context_menu/render_view_context_menu_browsertest_util.cc
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest_util.cc b/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest_util.cc
index ca8e7884c8e4d55556de5fa15b47829386ece095..8548f9c2af4cb7f9db4f77257ac1eee39a2b6980 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest_util.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest_util.cc
@@ -29,20 +29,13 @@ void ContextMenuNotificationObserver::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- switch (type) {
- case chrome::NOTIFICATION_RENDER_VIEW_CONTEXT_MENU_SHOWN: {
- RenderViewContextMenu* context_menu =
- content::Source<RenderViewContextMenu>(source).ptr();
- base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE,
- base::Bind(&ContextMenuNotificationObserver::ExecuteCommand,
- base::Unretained(this), context_menu));
- break;
- }
+ DCHECK_EQ(chrome::NOTIFICATION_RENDER_VIEW_CONTEXT_MENU_SHOWN, type);
- default:
- NOTREACHED();
- }
+ RenderViewContextMenu* context_menu =
+ content::Source<RenderViewContextMenu>(source).ptr();
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&ContextMenuNotificationObserver::ExecuteCommand,
+ base::Unretained(this), context_menu));
}
void ContextMenuNotificationObserver::ExecuteCommand(
« no previous file with comments | « chrome/browser/profiles/profile_shortcut_manager_win.cc ('k') | chrome/browser/safe_browsing/client_side_detection_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698