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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host_view_views_gtk.cc

Issue 7206055: Add an option to run Chrome in the views desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/renderer_host/render_widget_host_view_views.h"
6
7 #include "ui/base/keycodes/keyboard_code_conversion_gtk.h"
8 #include "ui/base/x/x11_util.h"
9 #include "ui/gfx/gtk_native_view_id_manager.h"
10 #include "views/widget/native_widget_gtk.h"
11
12 void RenderWidgetHostViewViews::UpdateCursor(const WebCursor& cursor) {
13 // Optimize the common case, where the cursor hasn't changed.
14 // However, we can switch between different pixmaps, so only on the
15 // non-pixmap branch.
16 if (current_cursor_.GetCursorType() != GDK_CURSOR_IS_PIXMAP &&
17 current_cursor_.GetCursorType() == cursor.GetCursorType()) {
18 return;
19 }
20
21 current_cursor_ = cursor;
22 ShowCurrentCursor();
23 }
24
25 void RenderWidgetHostViewViews::CreatePluginContainer(
26 gfx::PluginWindowHandle id) {
27 // TODO(anicolao): plugin_container_manager_.CreatePluginContainer(id);
28 }
29
30 void RenderWidgetHostViewViews::DestroyPluginContainer(
31 gfx::PluginWindowHandle id) {
32 // TODO(anicolao): plugin_container_manager_.DestroyPluginContainer(id);
33 }
34
35 void RenderWidgetHostViewViews::AcceleratedCompositingActivated(
36 bool activated) {
37 // TODO(anicolao): figure out if we need something here
38 if (activated)
39 NOTIMPLEMENTED();
40 }
41
42 gfx::PluginWindowHandle RenderWidgetHostViewViews::GetCompositingSurface() {
43 GtkNativeViewManager* manager = GtkNativeViewManager::GetInstance();
44 gfx::PluginWindowHandle surface = gfx::kNullPluginWindow;
45 gfx::NativeViewId view_id = gfx::IdFromNativeView(GetInnerNativeView());
46
47 if (!manager->GetXIDForId(&surface, view_id)) {
48 DLOG(ERROR) << "Can't find XID for view id " << view_id;
49 }
50 return surface;
51 }
52
53 gfx::NativeView RenderWidgetHostViewViews::GetInnerNativeView() const {
54 // TODO(sad): Ideally this function should be equivalent to GetNativeView, and
55 // NativeWidgetGtk-specific function call should not be necessary.
56 const views::Widget* widget = GetWidget();
57 const views::NativeWidget* native = widget ? widget->native_widget() : NULL;
58 return native ? static_cast<const views::NativeWidgetGtk*>(native)->
59 window_contents() : NULL;
60 }
61
62 void RenderWidgetHostViewViews::ShowCurrentCursor() {
63 // The widget may not have a window. If that's the case, abort mission. This
64 // is the same issue as that explained above in Paint().
65 if (!GetInnerNativeView() || !GetInnerNativeView()->window)
66 return;
67
68 native_cursor_ = current_cursor_.GetNativeCursor();
69 }
70
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698