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

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

Issue 197533008: Mac: ExternalPopupMenu::close should hide a showing popup menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: apply comments Created 6 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 | Annotate | Revision Log
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/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 4920 matching lines...) Expand 10 before | Expand all | Expand 10 after
4931 // it to the browser UI thread. Ignore the extra-messages. 4931 // it to the browser UI thread. Ignore the extra-messages.
4932 // TODO(jcivelli): http:/b/5793321 Implement a better fix, as detailed in bug. 4932 // TODO(jcivelli): http:/b/5793321 Implement a better fix, as detailed in bug.
4933 if (!external_popup_menu_) 4933 if (!external_popup_menu_)
4934 return; 4934 return;
4935 4935
4936 external_popup_menu_->DidSelectItems(canceled, selected_indices); 4936 external_popup_menu_->DidSelectItems(canceled, selected_indices);
4937 external_popup_menu_.reset(); 4937 external_popup_menu_.reset();
4938 } 4938 }
4939 #endif 4939 #endif
4940 4940
4941 void RenderViewImpl::DidHideExternalPopupMenu() {
4942 // We need to clear external_popup_menu_ as soon as ExternalPopupMenu::close
4943 // is called. Otherwise, createExternalPopupMenu() for new popup will fail.
4944 external_popup_menu_.reset();
4945 }
4946
4941 void RenderViewImpl::OnShowContextMenu(const gfx::Point& location) { 4947 void RenderViewImpl::OnShowContextMenu(const gfx::Point& location) {
4942 context_menu_source_type_ = ui::MENU_SOURCE_TOUCH_EDIT_MENU; 4948 context_menu_source_type_ = ui::MENU_SOURCE_TOUCH_EDIT_MENU;
4943 touch_editing_context_menu_location_ = location; 4949 touch_editing_context_menu_location_ = location;
4944 if (webview()) 4950 if (webview())
4945 webview()->showContextMenu(); 4951 webview()->showContextMenu();
4946 } 4952 }
4947 4953
4948 void RenderViewImpl::OnEnableViewSourceMode() { 4954 void RenderViewImpl::OnEnableViewSourceMode() {
4949 if (!webview()) 4955 if (!webview())
4950 return; 4956 return;
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
5127 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size()); 5133 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size());
5128 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 5134 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
5129 if (!url.isEmpty()) 5135 if (!url.isEmpty())
5130 urls.push_back( 5136 urls.push_back(
5131 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 5137 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
5132 } 5138 }
5133 SendUpdateFaviconURL(urls); 5139 SendUpdateFaviconURL(urls);
5134 } 5140 }
5135 5141
5136 } // namespace content 5142 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698