OLD | NEW |
| (Empty) |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_SEARCH_INSTANT_EXTENDED_CONTEXT_MENU_OBSERVER_H_ | |
6 #define CHROME_BROWSER_SEARCH_INSTANT_EXTENDED_CONTEXT_MENU_OBSERVER_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/compiler_specific.h" | |
10 #include "chrome/browser/tab_contents/render_view_context_menu_observer.h" | |
11 | |
12 namespace content { | |
13 class WebContents; | |
14 } | |
15 | |
16 // This class disables menu items which perform poorly in instant extended mode. | |
17 class InstantExtendedContextMenuObserver | |
18 : public RenderViewContextMenuObserver { | |
19 public: | |
20 explicit InstantExtendedContextMenuObserver(content::WebContents* contents); | |
21 virtual ~InstantExtendedContextMenuObserver(); | |
22 | |
23 // RenderViewContextMenuObserver implementation. | |
24 virtual bool IsCommandIdSupported(int command_id) OVERRIDE; | |
25 virtual bool IsCommandIdEnabled(int command_id) OVERRIDE; | |
26 | |
27 private: | |
28 // Whether the source web contents of the context menu corresponds to an | |
29 // Instant overlay. | |
30 const bool is_instant_overlay_; | |
31 | |
32 DISALLOW_COPY_AND_ASSIGN(InstantExtendedContextMenuObserver); | |
33 }; | |
34 | |
35 #endif // CHROME_BROWSER_SEARCH_INSTANT_EXTENDED_CONTEXT_MENU_OBSERVER_H_ | |
OLD | NEW |