OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BROWSERTES T_UTIL_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BROWSERTES T_UTIL_H_ |
6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BROWSERTES T_UTIL_H_ | 6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BROWSERTES T_UTIL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
11 #include "content/public/browser/notification_registrar.h" | 11 #include "content/public/browser/notification_registrar.h" |
12 #include "content/public/common/context_menu_params.h" | 12 #include "content/public/common/context_menu_params.h" |
13 | 13 |
14 class RenderViewContextMenu; | 14 class RenderViewContextMenu; |
15 | 15 |
16 class ContextMenuNotificationObserver : public content::NotificationObserver { | 16 class ContextMenuNotificationObserver : public content::NotificationObserver { |
17 public: | 17 public: |
18 // Wait for a context menu to be shown, and then execute |command_to_execute|. | 18 // Wait for a context menu to be shown, and then execute |command_to_execute|. |
19 explicit ContextMenuNotificationObserver(int command_to_execute); | 19 explicit ContextMenuNotificationObserver(int command_to_execute); |
20 virtual ~ContextMenuNotificationObserver(); | 20 virtual ~ContextMenuNotificationObserver(); |
21 void SetCommandId(int id) { command_to_execute_ = id; } | |
lazyboy
2014/09/19 21:38:18
Revert this change.
pals
2014/09/22 05:05:26
Done.
| |
21 | 22 |
22 private: | 23 private: |
23 virtual void Observe(int type, | 24 virtual void Observe(int type, |
24 const content::NotificationSource& source, | 25 const content::NotificationSource& source, |
25 const content::NotificationDetails& details) OVERRIDE; | 26 const content::NotificationDetails& details) OVERRIDE; |
26 | 27 |
27 void ExecuteCommand(RenderViewContextMenu* context_menu); | 28 void ExecuteCommand(RenderViewContextMenu* context_menu); |
28 | 29 |
29 content::NotificationRegistrar registrar_; | 30 content::NotificationRegistrar registrar_; |
30 int command_to_execute_; | 31 int command_to_execute_; |
(...skipping 24 matching lines...) Expand all Loading... | |
55 | 56 |
56 void Cancel(RenderViewContextMenu* context_menu); | 57 void Cancel(RenderViewContextMenu* context_menu); |
57 | 58 |
58 bool menu_visible_; | 59 bool menu_visible_; |
59 content::ContextMenuParams params_; | 60 content::ContextMenuParams params_; |
60 | 61 |
61 DISALLOW_COPY_AND_ASSIGN(SaveLinkAsContextMenuObserver); | 62 DISALLOW_COPY_AND_ASSIGN(SaveLinkAsContextMenuObserver); |
62 }; | 63 }; |
63 | 64 |
64 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BROWSER TEST_UTIL_H_ | 65 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BROWSER TEST_UTIL_H_ |
OLD | NEW |