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

Unified Diff: chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc

Issue 9478015: Aura: Build on the linux desktop, plus add USE_ASH. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Attempt to refix chromeos Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc
diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc
index 8834f813931ef736722d47d6bc070c364ac459ee..cd3f4e346b2ff1722f349d057afbf43b17f0091a 100644
--- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc
+++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc
@@ -4,9 +4,6 @@
#include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.h"
-// TODO(beng): USE_ASH
-#include "ash/shell.h"
-#include "ash/wm/visibility_controller.h"
#include "base/event_types.h"
#include "base/message_loop.h"
#include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate.h"
@@ -26,6 +23,11 @@
#include "ui/views/widget/widget.h"
#include "webkit/glue/webdropdata.h"
+#if defined(USE_ASH)
+#include "ash/shell.h"
+#include "ash/wm/visibility_controller.h"
+#endif
+
using content::RenderWidgetHostView;
using content::WebContents;
@@ -50,6 +52,7 @@ class WebDragSourceAura : public MessageLoopForUI::Observer {
return base::EVENT_CONTINUE;
}
virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE {
+#if defined(USE_ASH)
ui::EventType type = ui::EventTypeFromNative(event);
RenderViewHost* rvh = NULL;
switch (type) {
@@ -68,8 +71,12 @@ class WebDragSourceAura : public MessageLoopForUI::Observer {
default:
break;
}
+#else
+ NOTIMPLEMENTED();
+#endif
}
+
private:
NativeTabContentsViewAura* view_;
@@ -157,7 +164,11 @@ void NativeTabContentsViewAura::InitNativeTabContentsView() {
params.parent = NULL;
params.can_activate = true;
GetWidget()->Init(params);
+#if defined(USE_ASH)
ash::SetChildWindowVisibilityChangesAnimated(GetWidget()->GetNativeView());
+#else
+ NOTIMPLEMENTED() << "Need to animate in";
+#endif
// Hide the widget to prevent it from showing up on the root window. This is
// needed for TabContentses that aren't immediately added to the tabstrip,
@@ -212,6 +223,7 @@ void NativeTabContentsViewAura::StartDragging(const WebDropData& drop_data,
scoped_ptr<WebDragSourceAura> drag_source(new WebDragSourceAura(this));
+#if defined(USE_ASH)
Ben Goodger (Google) 2012/02/28 20:12:06 I don't see why this is Ash-specific?
// We need to enable recursive tasks on the message loop so we can get
// updates while in the system DoDragDrop loop.
int result_op = 0;
@@ -226,8 +238,11 @@ void NativeTabContentsViewAura::StartDragging(const WebDropData& drop_data,
result_op = aura::client::GetDragDropClient(root_window)->StartDragAndDrop(
data, location, ConvertFromWeb(ops));
}
-
EndDrag(ConvertToWeb(result_op));
+#else
+ NOTIMPLEMENTED() << "Drops without ash aren't implemented.";
+#endif
+
GetWebContents()->GetRenderViewHost()->DragSourceSystemDragEnded();
}
@@ -284,20 +299,29 @@ void NativeTabContentsViewAura::OnDragEntered(
const aura::DropTargetEvent& event) {
WebDropData drop_data;
PrepareWebDropData(&drop_data, event.data());
+#if defined(USE_ASH)
WebKit::WebDragOperationsMask op = ConvertToWeb(event.source_operations());
gfx::Point screen_pt = ash::Shell::GetRootWindow()->last_mouse_location();
Ben Goodger (Google) 2012/02/28 20:12:06 replace ash::Shell::GetRootWindow() with: GetNati
GetWebContents()->GetRenderViewHost()->DragTargetDragEnter(
drop_data, event.location(), screen_pt, op);
+#else
+ NOTIMPLEMENTED();
+#endif
}
int NativeTabContentsViewAura::OnDragUpdated(
const aura::DropTargetEvent& event) {
+#if defined(USE_ASH)
WebKit::WebDragOperationsMask op = ConvertToWeb(event.source_operations());
gfx::Point screen_pt = ash::Shell::GetRootWindow()->last_mouse_location();
Ben Goodger (Google) 2012/02/28 20:12:06 same here
GetWebContents()->GetRenderViewHost()->DragTargetDragOver(
event.location(), screen_pt, op);
return ConvertFromWeb(current_drag_op_);
+#else
+ NOTIMPLEMENTED();
+ return -1;
+#endif
}
void NativeTabContentsViewAura::OnDragExited() {
@@ -306,15 +330,21 @@ void NativeTabContentsViewAura::OnDragExited() {
int NativeTabContentsViewAura::OnPerformDrop(
const aura::DropTargetEvent& event) {
+#if defined(USE_ASH)
GetWebContents()->GetRenderViewHost()->DragTargetDrop(
event.location(), ash::Shell::GetRootWindow()->last_mouse_location());
Ben Goodger (Google) 2012/02/28 20:12:06 and here
return current_drag_op_;
+#else
+ NOTIMPLEMENTED();
+ return -1;
+#endif
}
////////////////////////////////////////////////////////////////////////////////
// NativeTabContentsViewAura, private:
void NativeTabContentsViewAura::EndDrag(WebKit::WebDragOperationsMask ops) {
+#if defined(USE_ASH)
gfx::Point screen_loc =
ash::Shell::GetRootWindow()->last_mouse_location();
Ben Goodger (Google) 2012/02/28 20:12:06 and here
gfx::Point client_loc = screen_loc;
@@ -324,6 +354,9 @@ void NativeTabContentsViewAura::EndDrag(WebKit::WebDragOperationsMask ops) {
window, &client_loc);
rvh->DragSourceEndedAt(client_loc.x(), client_loc.y(), screen_loc.x(),
screen_loc.y(), ops);
+#else
+ NOTIMPLEMENTED();
+#endif
}
////////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698