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 "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
10 #include "content/public/browser/notification_registrar.h" | 11 #include "content/public/browser/notification_registrar.h" |
11 | 12 |
12 class RenderViewContextMenu; | 13 class RenderViewContextMenu; |
13 | 14 |
14 class ContextMenuNotificationObserver : public content::NotificationObserver { | 15 class ContextMenuNotificationObserver : public content::NotificationObserver { |
15 public: | 16 public: |
16 // Wait for a context menu to be shown, and then execute |command_to_execute|. | 17 // Wait for a context menu to be shown, and then execute |command_to_execute|. |
17 explicit ContextMenuNotificationObserver(int command_to_execute); | 18 explicit ContextMenuNotificationObserver(int command_to_execute); |
18 virtual ~ContextMenuNotificationObserver(); | 19 virtual ~ContextMenuNotificationObserver(); |
19 | 20 |
| 21 // Suggested filename for file downloaded through "Save Link As" option. |
| 22 base::string16 GetSuggestedFilename(); |
| 23 |
| 24 // Wait for context menu to be visible. |
| 25 void WaitForMenu(); |
| 26 |
20 private: | 27 private: |
21 virtual void Observe(int type, | 28 virtual void Observe(int type, |
22 const content::NotificationSource& source, | 29 const content::NotificationSource& source, |
23 const content::NotificationDetails& details) OVERRIDE; | 30 const content::NotificationDetails& details) OVERRIDE; |
24 | 31 |
25 void ExecuteCommand(RenderViewContextMenu* context_menu); | 32 void ExecuteCommand(RenderViewContextMenu* context_menu); |
26 | 33 |
| 34 RenderViewContextMenu* context_menu_; |
27 content::NotificationRegistrar registrar_; | 35 content::NotificationRegistrar registrar_; |
28 int command_to_execute_; | 36 int command_to_execute_; |
| 37 bool menu_visible_; |
29 | 38 |
30 DISALLOW_COPY_AND_ASSIGN(ContextMenuNotificationObserver); | 39 DISALLOW_COPY_AND_ASSIGN(ContextMenuNotificationObserver); |
31 }; | 40 }; |
32 | 41 |
33 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BROWSER
TEST_UTIL_H_ | 42 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BROWSER
TEST_UTIL_H_ |
OLD | NEW |