summaryrefslogtreecommitdiffstats
path: root/content/browser
diff options
context:
space:
mode:
authorsaintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-18 17:28:50 +0000
committersaintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-18 17:28:50 +0000
commit3fa441d238ffa7b2cfbc4c7b623f8cb00b7c18ea (patch)
tree84794a37e500c230cb702d38aed4f3363afe755f /content/browser
parent97fe97e78d76db3c5a0ee7c1baa06d1fcd082a1a (diff)
downloadchromium_src-3fa441d238ffa7b2cfbc4c7b623f8cb00b7c18ea.zip
chromium_src-3fa441d238ffa7b2cfbc4c7b623f8cb00b7c18ea.tar.gz
chromium_src-3fa441d238ffa7b2cfbc4c7b623f8cb00b7c18ea.tar.bz2
Aura under Linux is enabled with:
'use_aura': 1, BUG=none TEST=none Review URL: http://codereview.chromium.org/7850026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101704 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
-rw-r--r--content/browser/browser_main.cc5
-rw-r--r--content/browser/gpu/gpu_process_host.cc16
-rw-r--r--content/browser/gpu/gpu_process_host.h2
-rw-r--r--content/browser/plugin_process_host.cc2
-rw-r--r--content/browser/renderer_host/render_message_filter_aura.cc3
-rw-r--r--content/browser/renderer_host/render_widget_host.cc6
-rw-r--r--content/browser/renderer_host/render_widget_host_view.cc4
7 files changed, 24 insertions, 14 deletions
diff --git a/content/browser/browser_main.cc b/content/browser/browser_main.cc
index 639e901..b2ba07d 100644
--- a/content/browser/browser_main.cc
+++ b/content/browser/browser_main.cc
@@ -291,7 +291,12 @@ void BrowserMainParts::InitializeToolkit() {
// TODO(satorux, stevenjb): remove this once it is no longer needed.
dbus_g_thread_init();
#endif
+#if defined(USE_AURA)
+ // TODO(saintlou): We still need some GTK at the lowest level, so init here.
+ gtk_init(NULL, NULL);
+#else
gfx::GtkInitFromCommandLine(parameters().command_line_);
+#endif
SetUpGLibLogHandler();
#endif
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 85d6b5f..49c2572 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -59,7 +59,7 @@ static const int kGpuMaxCrashCount = 3;
int g_last_host_id = 0;
-#if defined(TOOLKIT_USES_GTK)
+#if defined(TOOLKIT_USES_GTK) && !defined(USE_AURA)
class ReleasePermanentXIDDispatcher: public Task {
public:
@@ -95,7 +95,7 @@ void SendGpuProcessMessage(int renderer_id,
} // anonymous namespace
-#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI)
+#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) && !defined(USE_AURA)
// Used to put a lock on surfaces so that the window to which the GPU
// process is drawing to doesn't disappear while it is drawing when
// a tab is closed.
@@ -120,7 +120,7 @@ GpuProcessHost::SurfaceRef::~SurfaceRef() {
FROM_HERE,
new ReleasePermanentXIDDispatcher(surface_));
}
-#endif // defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI)
+#endif // defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) && !defined(USE_AURA)
// This class creates a GPU thread (instead of a GPU process), when running
// with --in-process-gpu or --single-process.
@@ -371,7 +371,7 @@ void GpuProcessHost::CreateViewCommandBuffer(
DCHECK(CalledOnValidThread());
linked_ptr<CreateCommandBufferCallback> wrapped_callback(callback);
-#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI)
+#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) && !defined(USE_AURA)
ViewID view_id(renderer_id, render_view_id);
// There should only be one such command buffer (for the compositor). In
@@ -384,13 +384,13 @@ void GpuProcessHost::CreateViewCommandBuffer(
surface_ref = (*it).second;
else
surface_ref.reset(new SurfaceRef(compositing_surface));
-#endif // defined(TOOLKIT_USES_GTK) && defined(TOUCH_UI)
+#endif // defined(TOOLKIT_USES_GTK) && defined(TOUCH_UI) && !defined(USE_AURA)
if (compositing_surface != gfx::kNullPluginWindow &&
Send(new GpuMsg_CreateViewCommandBuffer(
compositing_surface, render_view_id, renderer_id, init_params))) {
create_command_buffer_requests_.push(wrapped_callback);
-#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI)
+#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) && !defined(USE_AURA)
surface_refs_.insert(std::pair<ViewID, linked_ptr<SurfaceRef> >(
view_id, surface_ref));
#endif
@@ -443,12 +443,12 @@ void GpuProcessHost::OnCommandBufferCreated(const int32 route_id) {
void GpuProcessHost::OnDestroyCommandBuffer(
gfx::PluginWindowHandle window, int32 renderer_id,
int32 render_view_id) {
-#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI)
+#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) && !defined(USE_AURA)
ViewID view_id(renderer_id, render_view_id);
SurfaceRefMap::iterator it = surface_refs_.find(view_id);
if (it != surface_refs_.end())
surface_refs_.erase(it);
-#endif // defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI)
+#endif // defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) && !defined(USE_AURA)
}
void GpuProcessHost::OnGraphicsInfoCollected(const GPUInfo& gpu_info) {
diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h
index b337176..15ce84d 100644
--- a/content/browser/gpu/gpu_process_host.h
+++ b/content/browser/gpu/gpu_process_host.h
@@ -123,7 +123,7 @@ class GpuProcessHost : public BrowserChildProcessHost,
std::queue<linked_ptr<CreateCommandBufferCallback> >
create_command_buffer_requests_;
-#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI)
+#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) && !defined(USE_AURA)
typedef std::pair<int32 /* renderer_id */,
int32 /* render_view_id */> ViewID;
diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc
index 665d4f0..7b48aea 100644
--- a/content/browser/plugin_process_host.cc
+++ b/content/browser/plugin_process_host.cc
@@ -102,7 +102,9 @@ void PluginProcessHost::OnReparentPluginWindow(HWND window, HWND parent) {
void PluginProcessHost::OnMapNativeViewId(gfx::NativeViewId id,
gfx::PluginWindowHandle* output) {
*output = 0;
+#if !defined(USE_AURA)
GtkNativeViewManager::GetInstance()->GetXIDForId(output, id);
+#endif
}
#endif // defined(TOOLKIT_USES_GTK)
diff --git a/content/browser/renderer_host/render_message_filter_aura.cc b/content/browser/renderer_host/render_message_filter_aura.cc
index 311b163..a4d7a04 100644
--- a/content/browser/renderer_host/render_message_filter_aura.cc
+++ b/content/browser/renderer_host/render_message_filter_aura.cc
@@ -6,7 +6,7 @@
// TODO(shess): Provide a mapping from reply_msg->routing_id() to HWND
// so that we can eliminate the NativeViewId parameter.
-
+#if defined(OS_WIN)
void RenderMessageFilter::OnGetWindowRect(gfx::NativeViewId window_id,
gfx::Rect* rect) {
// TODO(beng):
@@ -26,3 +26,4 @@ void RenderMessageFilter::OnGetScreenInfo(gfx::NativeViewId view,
// TODO(beng):
NOTIMPLEMENTED();
}
+#endif // OS_WIN
diff --git a/content/browser/renderer_host/render_widget_host.cc b/content/browser/renderer_host/render_widget_host.cc
index add827a..fe5816b 100644
--- a/content/browser/renderer_host/render_widget_host.cc
+++ b/content/browser/renderer_host/render_widget_host.cc
@@ -204,7 +204,7 @@ bool RenderWidgetHost::OnMessageReceived(const IPC::Message &msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceBuffersSwapped,
OnAcceleratedSurfaceBuffersSwapped)
#endif
-#if defined(TOOLKIT_USES_GTK)
+#if defined(TOOLKIT_USES_GTK) && !defined(USE_AURA)
IPC_MESSAGE_HANDLER(ViewHostMsg_CreatePluginContainer,
OnMsgCreatePluginContainer)
IPC_MESSAGE_HANDLER(ViewHostMsg_DestroyPluginContainer,
@@ -1105,7 +1105,7 @@ void RenderWidgetHost::OnMsgDidActivateAcceleratedCompositing(bool activated) {
#elif defined(OS_WIN)
if (view_)
view_->ShowCompositorHostWindow(is_accelerated_compositing_active_);
-#elif defined(TOOLKIT_USES_GTK)
+#elif defined(TOOLKIT_USES_GTK) && !defined(USE_AURA)
if (view_)
view_->AcceleratedCompositingActivated(activated);
#endif
@@ -1237,6 +1237,7 @@ void RenderWidgetHost::ProcessKeyboardEventAck(int type, bool processed) {
}
void RenderWidgetHost::ActivateDeferredPluginHandles() {
+#if !defined(USE_AURA)
if (view_ == NULL)
return;
@@ -1247,6 +1248,7 @@ void RenderWidgetHost::ActivateDeferredPluginHandles() {
}
deferred_plugin_handles_.clear();
+#endif
}
void RenderWidgetHost::StartUserGesture() {
diff --git a/content/browser/renderer_host/render_widget_host_view.cc b/content/browser/renderer_host/render_widget_host_view.cc
index 6f16071..ba714df 100644
--- a/content/browser/renderer_host/render_widget_host_view.cc
+++ b/content/browser/renderer_host/render_widget_host_view.cc
@@ -10,7 +10,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/mac/WebScreenInfoFactory.h"
#endif
-#if defined(TOUCH_UI)
+#if defined(TOUCH_UI) || defined(USE_AURA)
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
@@ -29,7 +29,7 @@ void RenderWidgetHostView::GetDefaultScreenInfo(
// TODO(erg): move this to render_widget_host_view_views_gtk.cc when if it
// moves to content.
-#if defined(TOUCH_UI)
+#if defined(TOUCH_UI) || defined(USE_AURA)
// static
void RenderWidgetHostView::GetDefaultScreenInfo(
WebKit::WebScreenInfo* results) {