OLD | NEW |
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/tab_contents/render_view_context_menu_browsertest_util.
h" | 5 #include "chrome/browser/tab_contents/render_view_context_menu_browsertest_util.
h" |
6 | 6 |
7 #include "base/message_loop.h" | |
8 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 10 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
11 #include "content/public/browser/notification_service.h" | 11 #include "content/public/browser/notification_service.h" |
12 | 12 |
13 ContextMenuNotificationObserver::ContextMenuNotificationObserver( | 13 ContextMenuNotificationObserver::ContextMenuNotificationObserver( |
14 int command_to_execute) | 14 int command_to_execute) |
15 : command_to_execute_(command_to_execute) { | 15 : command_to_execute_(command_to_execute) { |
16 registrar_.Add(this, | 16 registrar_.Add(this, |
17 chrome::NOTIFICATION_RENDER_VIEW_CONTEXT_MENU_SHOWN, | 17 chrome::NOTIFICATION_RENDER_VIEW_CONTEXT_MENU_SHOWN, |
18 content::NotificationService::AllSources()); | 18 content::NotificationService::AllSources()); |
(...skipping 20 matching lines...) Expand all Loading... |
39 default: | 39 default: |
40 NOTREACHED(); | 40 NOTREACHED(); |
41 } | 41 } |
42 } | 42 } |
43 | 43 |
44 void ContextMenuNotificationObserver::ExecuteCommand( | 44 void ContextMenuNotificationObserver::ExecuteCommand( |
45 RenderViewContextMenu* context_menu) { | 45 RenderViewContextMenu* context_menu) { |
46 context_menu->ExecuteCommand(command_to_execute_, 0); | 46 context_menu->ExecuteCommand(command_to_execute_, 0); |
47 context_menu->Cancel(); | 47 context_menu->Cancel(); |
48 } | 48 } |
OLD | NEW |