| 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 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_ANDROID_CONTEXT_MENU_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_ANDROID_CONTEXT_MENU_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_NTP_ANDROID_CONTEXT_MENU_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_ANDROID_CONTEXT_MENU_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "content/public/browser/web_ui_message_handler.h" | 9 #include "content/public/browser/web_ui_message_handler.h" |
| 10 #include "webkit/glue/window_open_disposition.h" | 10 #include "ui/base/window_open_disposition.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 class ListValue; | 13 class ListValue; |
| 14 } | 14 } |
| 15 | 15 |
| 16 // The handler for JavaScript messages related to the context menus. | 16 // The handler for JavaScript messages related to the context menus. |
| 17 // It's the job of the actual HTML page to intercept the contextmenu event, | 17 // It's the job of the actual HTML page to intercept the contextmenu event, |
| 18 // disable it and show its own custom menu. | 18 // disable it and show its own custom menu. |
| 19 class ContextMenuHandler : public content::WebUIMessageHandler { | 19 class ContextMenuHandler : public content::WebUIMessageHandler { |
| 20 public: | 20 public: |
| (...skipping 23 matching lines...) Expand all Loading... |
| 44 // |disposition|. The URL will always be opened as an AUTO_BOOKMARK. | 44 // |disposition|. The URL will always be opened as an AUTO_BOOKMARK. |
| 45 void OpenUrl(const base::ListValue* args, WindowOpenDisposition disposition); | 45 void OpenUrl(const base::ListValue* args, WindowOpenDisposition disposition); |
| 46 | 46 |
| 47 // Used to get a WeakPtr to self on the UI thread. | 47 // Used to get a WeakPtr to self on the UI thread. |
| 48 base::WeakPtrFactory<ContextMenuHandler> weak_ptr_factory_; | 48 base::WeakPtrFactory<ContextMenuHandler> weak_ptr_factory_; |
| 49 | 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(ContextMenuHandler); | 50 DISALLOW_COPY_AND_ASSIGN(ContextMenuHandler); |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 #endif // CHROME_BROWSER_UI_WEBUI_NTP_ANDROID_CONTEXT_MENU_HANDLER_H_ | 53 #endif // CHROME_BROWSER_UI_WEBUI_NTP_ANDROID_CONTEXT_MENU_HANDLER_H_ |
| OLD | NEW |