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

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

Issue 2751763002: Make USE_EXTERNAL_POPUP_MENU local to content. (Closed)
Patch Set: rebase Created 3 years, 9 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/render_frame_impl.h ('k') | content/renderer/render_thread_impl.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1468 1468
1469 void RenderFrameImpl::ScriptedPrint(bool user_initiated) { 1469 void RenderFrameImpl::ScriptedPrint(bool user_initiated) {
1470 for (auto& observer : observers_) 1470 for (auto& observer : observers_)
1471 observer.ScriptedPrint(user_initiated); 1471 observer.ScriptedPrint(user_initiated);
1472 } 1472 }
1473 1473
1474 bool RenderFrameImpl::Send(IPC::Message* message) { 1474 bool RenderFrameImpl::Send(IPC::Message* message) {
1475 return RenderThread::Get()->Send(message); 1475 return RenderThread::Get()->Send(message);
1476 } 1476 }
1477 1477
1478 #if defined(USE_EXTERNAL_POPUP_MENU) 1478 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
1479 void RenderFrameImpl::DidHideExternalPopupMenu() { 1479 void RenderFrameImpl::DidHideExternalPopupMenu() {
1480 // We need to clear external_popup_menu_ as soon as ExternalPopupMenu::close 1480 // We need to clear external_popup_menu_ as soon as ExternalPopupMenu::close
1481 // is called. Otherwise, createExternalPopupMenu() for new popup will fail. 1481 // is called. Otherwise, createExternalPopupMenu() for new popup will fail.
1482 external_popup_menu_.reset(); 1482 external_popup_menu_.reset();
1483 } 1483 }
1484 #endif 1484 #endif
1485 1485
1486 bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) { 1486 bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) {
1487 // Forward Page IPCs to the RenderView. 1487 // Forward Page IPCs to the RenderView.
1488 if ((IPC_MESSAGE_CLASS(msg) == PageMsgStart)) { 1488 if ((IPC_MESSAGE_CLASS(msg) == PageMsgStart)) {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 OnBlinkFeatureUsageReport) 1595 OnBlinkFeatureUsageReport)
1596 IPC_MESSAGE_HANDLER(FrameMsg_MixedContentFound, OnMixedContentFound) 1596 IPC_MESSAGE_HANDLER(FrameMsg_MixedContentFound, OnMixedContentFound)
1597 #if defined(OS_ANDROID) 1597 #if defined(OS_ANDROID)
1598 IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult, 1598 IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult,
1599 OnActivateNearestFindResult) 1599 OnActivateNearestFindResult)
1600 IPC_MESSAGE_HANDLER(FrameMsg_GetNearestFindResult, 1600 IPC_MESSAGE_HANDLER(FrameMsg_GetNearestFindResult,
1601 OnGetNearestFindResult) 1601 OnGetNearestFindResult)
1602 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects) 1602 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects)
1603 #endif 1603 #endif
1604 1604
1605 #if defined(USE_EXTERNAL_POPUP_MENU) 1605 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
1606 #if defined(OS_MACOSX) 1606 #if defined(OS_MACOSX)
1607 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) 1607 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem)
1608 #else 1608 #else
1609 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) 1609 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems)
1610 #endif 1610 #endif
1611 #endif 1611 #endif
1612 1612
1613 #if defined(OS_MACOSX) 1613 #if defined(OS_MACOSX)
1614 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) 1614 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard)
1615 #endif 1615 #endif
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
2953 RenderFrameImpl::createWorkerContentSettingsClientProxy() { 2953 RenderFrameImpl::createWorkerContentSettingsClientProxy() {
2954 if (!frame_ || !frame_->view()) 2954 if (!frame_ || !frame_->view())
2955 return NULL; 2955 return NULL;
2956 return GetContentClient()->renderer()->CreateWorkerContentSettingsClientProxy( 2956 return GetContentClient()->renderer()->CreateWorkerContentSettingsClientProxy(
2957 this, frame_); 2957 this, frame_);
2958 } 2958 }
2959 2959
2960 WebExternalPopupMenu* RenderFrameImpl::createExternalPopupMenu( 2960 WebExternalPopupMenu* RenderFrameImpl::createExternalPopupMenu(
2961 const WebPopupMenuInfo& popup_menu_info, 2961 const WebPopupMenuInfo& popup_menu_info,
2962 WebExternalPopupMenuClient* popup_menu_client) { 2962 WebExternalPopupMenuClient* popup_menu_client) {
2963 #if defined(USE_EXTERNAL_POPUP_MENU) 2963 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
2964 // An IPC message is sent to the browser to build and display the actual 2964 // An IPC message is sent to the browser to build and display the actual
2965 // popup. The user could have time to click a different select by the time 2965 // popup. The user could have time to click a different select by the time
2966 // the popup is shown. In that case external_popup_menu_ is non NULL. 2966 // the popup is shown. In that case external_popup_menu_ is non NULL.
2967 // By returning NULL in that case, we instruct Blink to cancel that new 2967 // By returning NULL in that case, we instruct Blink to cancel that new
2968 // popup. So from the user perspective, only the first one will show, and 2968 // popup. So from the user perspective, only the first one will show, and
2969 // will have to close the first one before another one can be shown. 2969 // will have to close the first one before another one can be shown.
2970 if (external_popup_menu_) 2970 if (external_popup_menu_)
2971 return NULL; 2971 return NULL;
2972 external_popup_menu_.reset( 2972 external_popup_menu_.reset(
2973 new ExternalPopupMenu(this, popup_menu_info, popup_menu_client)); 2973 new ExternalPopupMenu(this, popup_menu_info, popup_menu_client));
(...skipping 2804 matching lines...) Expand 10 before | Expand all | Expand 10 after
5778 for (size_t i = 0; i < web_match_rects.size(); ++i) 5778 for (size_t i = 0; i < web_match_rects.size(); ++i)
5779 match_rects.push_back(gfx::RectF(web_match_rects[i])); 5779 match_rects.push_back(gfx::RectF(web_match_rects[i]));
5780 } 5780 }
5781 5781
5782 gfx::RectF active_rect = frame_->activeFindMatchRect(); 5782 gfx::RectF active_rect = frame_->activeFindMatchRect();
5783 Send(new FrameHostMsg_FindMatchRects_Reply(routing_id_, rects_version, 5783 Send(new FrameHostMsg_FindMatchRects_Reply(routing_id_, rects_version,
5784 match_rects, active_rect)); 5784 match_rects, active_rect));
5785 } 5785 }
5786 #endif 5786 #endif
5787 5787
5788 #if defined(USE_EXTERNAL_POPUP_MENU) 5788 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
5789 #if defined(OS_MACOSX) 5789 #if defined(OS_MACOSX)
5790 void RenderFrameImpl::OnSelectPopupMenuItem(int selected_index) { 5790 void RenderFrameImpl::OnSelectPopupMenuItem(int selected_index) {
5791 if (external_popup_menu_ == NULL) 5791 if (external_popup_menu_ == NULL)
5792 return; 5792 return;
5793 external_popup_menu_->DidSelectItem(selected_index); 5793 external_popup_menu_->DidSelectItem(selected_index);
5794 external_popup_menu_.reset(); 5794 external_popup_menu_.reset();
5795 } 5795 }
5796 #else 5796 #else
5797 void RenderFrameImpl::OnSelectPopupMenuItems( 5797 void RenderFrameImpl::OnSelectPopupMenuItems(
5798 bool canceled, 5798 bool canceled,
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after
6889 // event target. Potentially a Pepper plugin will receive the event. 6889 // event target. Potentially a Pepper plugin will receive the event.
6890 // In order to tell whether a plugin gets the last mouse event and which it 6890 // In order to tell whether a plugin gets the last mouse event and which it
6891 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6891 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6892 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6892 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6893 // |pepper_last_mouse_event_target_|. 6893 // |pepper_last_mouse_event_target_|.
6894 pepper_last_mouse_event_target_ = nullptr; 6894 pepper_last_mouse_event_target_ = nullptr;
6895 #endif 6895 #endif
6896 } 6896 }
6897 6897
6898 } // namespace content 6898 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698