| 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 #include "content/renderer/external_popup_menu.h" | 5 #include "content/renderer/external_popup_menu.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "content/common/frame_messages.h" | 10 #include "content/common/frame_messages.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 void ExternalPopupMenu::DidSelectItem(int index) { | 67 void ExternalPopupMenu::DidSelectItem(int index) { |
| 68 if (!popup_menu_client_) | 68 if (!popup_menu_client_) |
| 69 return; | 69 return; |
| 70 if (index == -1) | 70 if (index == -1) |
| 71 popup_menu_client_->didCancel(); | 71 popup_menu_client_->didCancel(); |
| 72 else | 72 else |
| 73 popup_menu_client_->didAcceptIndex(index); | 73 popup_menu_client_->didAcceptIndex(index); |
| 74 } | 74 } |
| 75 #endif | 75 #endif |
| 76 | 76 |
| 77 #if defined(OS_ANDROID) | 77 #if defined(USE_EXTERNAL_POPUP_MENU) && !defined(OS_MACOSX) |
| 78 void ExternalPopupMenu::DidSelectItems(bool canceled, | 78 void ExternalPopupMenu::DidSelectItems(bool canceled, |
| 79 const std::vector<int>& indices) { | 79 const std::vector<int>& indices) { |
| 80 if (!popup_menu_client_) | 80 if (!popup_menu_client_) |
| 81 return; | 81 return; |
| 82 if (canceled) | 82 if (canceled) |
| 83 popup_menu_client_->didCancel(); | 83 popup_menu_client_->didCancel(); |
| 84 else | 84 else |
| 85 popup_menu_client_->didAcceptIndices(indices); | 85 popup_menu_client_->didAcceptIndices(indices); |
| 86 } | 86 } |
| 87 #endif | 87 #endif |
| 88 | 88 |
| 89 } // namespace content | 89 } // namespace content |
| OLD | NEW |