OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/renderer_host/render_widget_host_view.h" | 5 #include "content/browser/renderer_host/render_widget_host_view.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
9 | 9 |
10 #if defined(OS_MACOSX) | |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/mac/WebScreenInfoFact
ory.h" | |
12 #endif | |
13 | |
14 #if defined(TOOLKIT_USES_GTK) | 10 #if defined(TOOLKIT_USES_GTK) |
15 #include <gdk/gdkx.h> | 11 #include <gdk/gdkx.h> |
16 #include <gtk/gtk.h> | 12 #include <gtk/gtk.h> |
17 | 13 |
18 #include "content/browser/renderer_host/gtk_window_utils.h" | 14 #include "content/browser/renderer_host/gtk_window_utils.h" |
19 #endif | 15 #endif |
20 | 16 |
21 // TODO(jam): move this to render_widget_host_view_mac.mm when it moves to | 17 #if defined(TOUCH_UI) |
22 // content. | |
23 #if defined(OS_MACOSX) | |
24 // static | |
25 void RenderWidgetHostView::GetDefaultScreenInfo( | |
26 WebKit::WebScreenInfo* results) { | |
27 *results = WebKit::WebScreenInfoFactory::screenInfo(NULL); | |
28 } | |
29 #endif | |
30 | |
31 #if defined(OS_POSIX) && defined(USE_AURA) | |
32 // static | |
33 void RenderWidgetHostView::GetDefaultScreenInfo( | |
34 WebKit::WebScreenInfo* results) { | |
35 NOTIMPLEMENTED(); | |
36 } | |
37 #elif defined(TOUCH_UI) | |
38 // static | 18 // static |
39 void RenderWidgetHostView::GetDefaultScreenInfo( | 19 void RenderWidgetHostView::GetDefaultScreenInfo( |
40 WebKit::WebScreenInfo* results) { | 20 WebKit::WebScreenInfo* results) { |
41 GdkWindow* gdk_window = | 21 GdkWindow* gdk_window = |
42 gdk_display_get_default_group(gdk_display_get_default()); | 22 gdk_display_get_default_group(gdk_display_get_default()); |
43 content::GetScreenInfoFromNativeWindow(gdk_window, results); | 23 content::GetScreenInfoFromNativeWindow(gdk_window, results); |
44 } | 24 } |
45 #endif | 25 #endif |
46 | 26 |
47 RenderWidgetHostView::RenderWidgetHostView() | 27 RenderWidgetHostView::RenderWidgetHostView() |
(...skipping 13 matching lines...) Expand all Loading... |
61 | 41 |
62 | 42 |
63 void RenderWidgetHostView::SelectionChanged(const string16& text, | 43 void RenderWidgetHostView::SelectionChanged(const string16& text, |
64 size_t offset, | 44 size_t offset, |
65 const ui::Range& range) { | 45 const ui::Range& range) { |
66 selection_text_ = text; | 46 selection_text_ = text; |
67 selection_text_offset_ = offset; | 47 selection_text_offset_ = offset; |
68 selection_range_.set_start(range.start()); | 48 selection_range_.set_start(range.start()); |
69 selection_range_.set_end(range.end()); | 49 selection_range_.set_end(range.end()); |
70 } | 50 } |
OLD | NEW |