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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 new FrameHostMsg_ShowPopup(render_frame_->GetRoutingID(), popup_params)); | 56 new FrameHostMsg_ShowPopup(render_frame_->GetRoutingID(), popup_params)); |
57 } | 57 } |
58 | 58 |
59 void ExternalPopupMenu::close() { | 59 void ExternalPopupMenu::close() { |
60 render_frame_->Send( | 60 render_frame_->Send( |
61 new FrameHostMsg_HidePopup(render_frame_->GetRoutingID())); | 61 new FrameHostMsg_HidePopup(render_frame_->GetRoutingID())); |
62 render_frame_->DidHideExternalPopupMenu(); | 62 render_frame_->DidHideExternalPopupMenu(); |
63 // |this| was deleted. | 63 // |this| was deleted. |
64 } | 64 } |
65 | 65 |
66 #if defined(USE_EXTERNAL_POPUP_MENU) | 66 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) |
67 #if defined(OS_MACOSX) | 67 #if defined(OS_MACOSX) |
68 void ExternalPopupMenu::DidSelectItem(int index) { | 68 void ExternalPopupMenu::DidSelectItem(int index) { |
69 if (!popup_menu_client_) | 69 if (!popup_menu_client_) |
70 return; | 70 return; |
71 if (index == -1) | 71 if (index == -1) |
72 popup_menu_client_->didCancel(); | 72 popup_menu_client_->didCancel(); |
73 else | 73 else |
74 popup_menu_client_->didAcceptIndex(index); | 74 popup_menu_client_->didAcceptIndex(index); |
75 } | 75 } |
76 #else | 76 #else |
77 void ExternalPopupMenu::DidSelectItems(bool canceled, | 77 void ExternalPopupMenu::DidSelectItems(bool canceled, |
78 const std::vector<int>& indices) { | 78 const std::vector<int>& indices) { |
79 if (!popup_menu_client_) | 79 if (!popup_menu_client_) |
80 return; | 80 return; |
81 if (canceled) | 81 if (canceled) |
82 popup_menu_client_->didCancel(); | 82 popup_menu_client_->didCancel(); |
83 else | 83 else |
84 popup_menu_client_->didAcceptIndices(indices); | 84 popup_menu_client_->didAcceptIndices(indices); |
85 } | 85 } |
86 #endif | 86 #endif |
87 #endif | 87 #endif |
88 | 88 |
89 } // namespace content | 89 } // namespace content |
OLD | NEW |