Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Side by Side Diff: content/renderer/external_popup_menu.cc

Issue 1992393002: Enable external popup menu in Blimp, part 1/2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and update blimp_engine.gn Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/external_popup_menu.h ('k') | content/renderer/render_frame_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 defined(OS_MACOSX) 67 #if defined(OS_MACOSX)
67 void ExternalPopupMenu::DidSelectItem(int index) { 68 void ExternalPopupMenu::DidSelectItem(int index) {
68 if (!popup_menu_client_) 69 if (!popup_menu_client_)
69 return; 70 return;
70 if (index == -1) 71 if (index == -1)
71 popup_menu_client_->didCancel(); 72 popup_menu_client_->didCancel();
72 else 73 else
73 popup_menu_client_->didAcceptIndex(index); 74 popup_menu_client_->didAcceptIndex(index);
74 } 75 }
75 #endif 76 #else
76
77 #if defined(OS_ANDROID)
78 void ExternalPopupMenu::DidSelectItems(bool canceled, 77 void ExternalPopupMenu::DidSelectItems(bool canceled,
79 const std::vector<int>& indices) { 78 const std::vector<int>& indices) {
80 if (!popup_menu_client_) 79 if (!popup_menu_client_)
81 return; 80 return;
82 if (canceled) 81 if (canceled)
83 popup_menu_client_->didCancel(); 82 popup_menu_client_->didCancel();
84 else 83 else
85 popup_menu_client_->didAcceptIndices(indices); 84 popup_menu_client_->didAcceptIndices(indices);
86 } 85 }
87 #endif 86 #endif
87 #endif
88 88
89 } // namespace content 89 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/external_popup_menu.h ('k') | content/renderer/render_frame_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698