| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "content/renderer/external_popup_menu.h" | 5 #include "content/renderer/external_popup_menu.h" |
| 6 | 6 |
| 7 #include "content/common/view_messages.h" | 7 #include "content/common/view_messages.h" |
| 8 #include "content/renderer/render_view_impl.h" | 8 #include "content/renderer/render_view_impl.h" |
| 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebExternalPopupMenuC
lient.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebExternalPopupMenuC
lient.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" |
| 11 | 11 |
| 12 ExternalPopupMenu::ExternalPopupMenu( | 12 ExternalPopupMenu::ExternalPopupMenu( |
| 13 RenderViewImpl* render_view, | 13 RenderViewImpl* render_view, |
| 14 const WebKit::WebPopupMenuInfo& popup_menu_info, | 14 const WebKit::WebPopupMenuInfo& popup_menu_info, |
| 15 WebKit::WebExternalPopupMenuClient* popup_menu_client) | 15 WebKit::WebExternalPopupMenuClient* popup_menu_client) |
| 16 : render_view_(render_view), | 16 : render_view_(render_view), |
| 17 popup_menu_info_(popup_menu_info), | 17 popup_menu_info_(popup_menu_info), |
| 18 popup_menu_client_(popup_menu_client) { | 18 popup_menu_client_(popup_menu_client) { |
| 19 } | 19 } |
| 20 | 20 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 37 } | 37 } |
| 38 | 38 |
| 39 void ExternalPopupMenu::DidSelectItem(int index) { | 39 void ExternalPopupMenu::DidSelectItem(int index) { |
| 40 if (!popup_menu_client_) | 40 if (!popup_menu_client_) |
| 41 return; | 41 return; |
| 42 if (index == -1) | 42 if (index == -1) |
| 43 popup_menu_client_->didCancel(); | 43 popup_menu_client_->didCancel(); |
| 44 else | 44 else |
| 45 popup_menu_client_->didAcceptIndex(index); | 45 popup_menu_client_->didAcceptIndex(index); |
| 46 } | 46 } |
| OLD | NEW |