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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac_dictionary_helper.mm

Issue 1396243002: Using the correct target NSView to show the dictionary bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/browser/renderer_host/render_widget_host_view_mac.mm ('k') | no next file » | 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 #import "content/browser/renderer_host/render_widget_host_view_mac_dictionary_he lper.h" 5 #import "content/browser/renderer_host/render_widget_host_view_mac_dictionary_he lper.h"
6 6
7 #include "base/strings/sys_string_conversions.h" 7 #include "base/strings/sys_string_conversions.h"
8 #import "content/browser/renderer_host/render_widget_host_view_mac.h" 8 #import "content/browser/renderer_host/render_widget_host_view_mac.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 RenderWidgetHostViewMacDictionaryHelper:: 12 RenderWidgetHostViewMacDictionaryHelper::
13 RenderWidgetHostViewMacDictionaryHelper(RenderWidgetHostView* view) 13 RenderWidgetHostViewMacDictionaryHelper(RenderWidgetHostView* view)
14 : view_(static_cast<RenderWidgetHostViewMac*>(view)), 14 : view_(static_cast<RenderWidgetHostViewMac*>(view)),
15 target_view_(static_cast<RenderWidgetHostViewMac*>(view)) { 15 target_view_(static_cast<RenderWidgetHostViewMac*>(view)) {
16 } 16 }
17 17
18 void RenderWidgetHostViewMacDictionaryHelper::SetTargetView( 18 void RenderWidgetHostViewMacDictionaryHelper::SetTargetView(
19 RenderWidgetHostView* target_view) { 19 RenderWidgetHostView* target_view) {
20 target_view_ = static_cast<RenderWidgetHostViewMac*>(target_view); 20 target_view_ = static_cast<RenderWidgetHostViewMac*>(target_view);
21 } 21 }
22 22
23 void RenderWidgetHostViewMacDictionaryHelper::ShowDefinitionForSelection() { 23 void RenderWidgetHostViewMacDictionaryHelper::ShowDefinitionForSelection() {
24 NSRange selection_range = [view_->cocoa_view() selectedRange]; 24 NSRange selection_range = [view_->cocoa_view() selectedRange];
25 [view_->cocoa_view() showLookUpDictionaryOverlayFromRange:selection_range]; 25 NSView* view = target_view_->cocoa_view();
26 [view_->cocoa_view() showLookUpDictionaryOverlayFromRange:selection_range
27 targetView:view];
26 } 28 }
27 29
28 } // namespace content 30 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698