Add ICU message format support
[chromium-blink-merge.git] / content / browser / renderer_host / render_widget_host_view_mac_dictionary_helper.h
blob4a94d9feb22e02c9635a76d4df11cc28abd315ae
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_DICTIONARY_HELPER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_DICTIONARY_HELPER_H_
8 #include "base/basictypes.h"
9 #include "ui/gfx/geometry/vector2d.h"
11 namespace content {
13 class RenderWidgetHostView;
14 class RenderWidgetHostViewMac;
16 // A helper class to bring up definition of word for a RWHV.
18 // This is triggered by "Lookup in Dictionary" context menu item.
19 // Either uses Dictionary.app or a light-weight dictionary panel, based on
20 // system settings.
21 class RenderWidgetHostViewMacDictionaryHelper {
22 public:
23 explicit RenderWidgetHostViewMacDictionaryHelper(RenderWidgetHostView* view);
25 // Overrides the view to use to bring up dictionary panel.
26 // This |target_view| can be different from |view_|, |view_| is used to get
27 // the current selection value where |target_view| is used to bring up the
28 // cocoa dictionary panel.
29 void SetTargetView(RenderWidgetHostView* target_view);
30 void set_offset(const gfx::Vector2d& offset) { offset_ = offset; }
32 // Brings up either Dictionary.app or a light-weight dictionary panel,
33 // depending on system settings.
34 void ShowDefinitionForSelection();
36 private:
37 // This class shows definition for this view.
38 RenderWidgetHostViewMac* view_;
39 // This view is use to bring up the dictionary panel. Generally this is the
40 // same as |view_|. One can override the view to use via SetTargetView().
41 RenderWidgetHostViewMac* target_view_;
42 // The extra offset to use while positioning the dicitonary panel.
43 gfx::Vector2d offset_;
45 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMacDictionaryHelper);
48 } // namespace content
50 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_DICTIONARY_HELPER_H_