summaryrefslogtreecommitdiff
path: root/chromium/ui
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui')
-rw-r--r--chromium/ui/aura/aura.gyp1
-rw-r--r--chromium/ui/base/clipboard/clipboard.h15
-rw-r--r--chromium/ui/base/clipboard/clipboard_mac.mm4
-rw-r--r--chromium/ui/base/clipboard/clipboard_win.cc4
-rw-r--r--chromium/ui/compositor/test/test_compositor_host_ozone.cc69
-rw-r--r--chromium/ui/events/event.cc14
-rw-r--r--chromium/ui/gl/gl_share_group.cc3
-rw-r--r--chromium/ui/gl/gl_share_group.h7
-rw-r--r--chromium/ui/ui.gyp2
9 files changed, 87 insertions, 32 deletions
diff --git a/chromium/ui/aura/aura.gyp b/chromium/ui/aura/aura.gyp
index 139e0469ef2..68164d4321a 100644
--- a/chromium/ui/aura/aura.gyp
+++ b/chromium/ui/aura/aura.gyp
@@ -243,6 +243,7 @@
'type': 'executable',
'dependencies': [
'../../base/base.gyp:test_support_base',
+ '../../chrome/chrome_resources.gyp:packed_resources',
'../../skia/skia.gyp:skia',
'../../testing/gtest.gyp:gtest',
'../compositor/compositor.gyp:compositor',
diff --git a/chromium/ui/base/clipboard/clipboard.h b/chromium/ui/base/clipboard/clipboard.h
index 5cf936cdd6f..f818bd6a6df 100644
--- a/chromium/ui/base/clipboard/clipboard.h
+++ b/chromium/ui/base/clipboard/clipboard.h
@@ -88,7 +88,6 @@ class UI_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) {
bool operator<(const FormatType& other) const;
#endif
-#if !defined(TOOLKIT_QT)
#if defined(OS_WIN)
const FORMATETC& ToFormatEtc() const { return data_; }
#elif defined(OS_MACOSX)
@@ -98,15 +97,12 @@ class UI_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) {
#elif defined(USE_AURA)
const std::string& ToString() const { return data_; }
#endif
-#else
- const std::string& ToString() const { return data_; }
-#endif // !defined(TOOLKIT_QT)
+
+ bool Equals(const FormatType& other) const;
private:
friend class Clipboard;
- bool Equals(const FormatType& other) const;
-
// Platform-specific glue used internally by the Clipboard class. Each
// plaform should define,at least one of each of the following:
// 1. A constructor that wraps that native clipboard format descriptor.
@@ -115,10 +111,7 @@ class UI_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) {
//
// Note that in some cases, the accessor for the wrapped descriptor may be
// public, as these format types can be used by drag and drop code as well.
-#if defined(TOOLKIT_QT)
- explicit FormatType(const std::string& native_format);
- std::string data_;
-#elif defined(OS_WIN)
+#if defined(OS_WIN)
explicit FormatType(UINT native_format);
FormatType(UINT native_format, LONG index);
UINT ToUINT() const { return data_.cfFormat; }
@@ -346,7 +339,7 @@ class UI_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) {
void WriteData(const FormatType& format,
const char* data_data,
size_t data_len);
-#if !defined(TOOLKIT_QT) && defined(OS_WIN)
+#if defined(OS_WIN)
void WriteBitmapFromHandle(HBITMAP source_hbitmap,
const gfx::Size& size);
diff --git a/chromium/ui/base/clipboard/clipboard_mac.mm b/chromium/ui/base/clipboard/clipboard_mac.mm
index 8aee1d3bbfa..c4b69e804ef 100644
--- a/chromium/ui/base/clipboard/clipboard_mac.mm
+++ b/chromium/ui/base/clipboard/clipboard_mac.mm
@@ -70,6 +70,10 @@ Clipboard::FormatType& Clipboard::FormatType::operator=(
return *this;
}
+bool Clipboard::FormatType::Equals(const FormatType& other) const {
+ return [data_ isEqualToString:other.data_];
+}
+
Clipboard::FormatType::~FormatType() {
[data_ release];
}
diff --git a/chromium/ui/base/clipboard/clipboard_win.cc b/chromium/ui/base/clipboard/clipboard_win.cc
index 92632c74a96..24875aae013 100644
--- a/chromium/ui/base/clipboard/clipboard_win.cc
+++ b/chromium/ui/base/clipboard/clipboard_win.cc
@@ -203,6 +203,10 @@ bool Clipboard::FormatType::operator<(const FormatType& other) const {
return ToUINT() < other.ToUINT();
}
+bool Clipboard::FormatType::Equals(const FormatType& other) const {
+ return ToUINT() == other.ToUINT();
+}
+
Clipboard::Clipboard() {
if (base::MessageLoop::current()->type() == base::MessageLoop::TYPE_UI)
clipboard_owner_.reset(new base::win::MessageWindow());
diff --git a/chromium/ui/compositor/test/test_compositor_host_ozone.cc b/chromium/ui/compositor/test/test_compositor_host_ozone.cc
new file mode 100644
index 00000000000..78431bee417
--- /dev/null
+++ b/chromium/ui/compositor/test/test_compositor_host_ozone.cc
@@ -0,0 +1,69 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/compositor/test/test_compositor_host.h"
+
+#include "base/basictypes.h"
+#include "base/bind.h"
+#include "base/compiler_specific.h"
+#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "base/message_loop/message_loop.h"
+#include "ui/compositor/compositor.h"
+#include "ui/gfx/rect.h"
+
+namespace ui {
+
+class TestCompositorHostOzone : public TestCompositorHost {
+ public:
+ TestCompositorHostOzone(const gfx::Rect& bounds);
+ virtual ~TestCompositorHostOzone();
+
+ private:
+ // Overridden from TestCompositorHost:
+ virtual void Show() OVERRIDE;
+ virtual ui::Compositor* GetCompositor() OVERRIDE;
+
+ void Draw();
+
+ gfx::Rect bounds_;
+
+ scoped_ptr<ui::Compositor> compositor_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestCompositorHostOzone);
+};
+
+TestCompositorHostOzone::TestCompositorHostOzone(const gfx::Rect& bounds)
+ : bounds_(bounds) {}
+
+TestCompositorHostOzone::~TestCompositorHostOzone() {}
+
+void TestCompositorHostOzone::Show() {
+ // Ozone should rightly have a backing native framebuffer
+ // An in-memory array draw into by OSMesa is a reasonble
+ // fascimile of a dumb framebuffer at present.
+ // GLSurface will allocate the array so long as it is provided
+ // with a non-0 widget.
+ // TODO(rjkroege): Use a "real" ozone widget when it is
+ // available: http://crbug.com/255128
+ compositor_.reset(new ui::Compositor(1));
+ compositor_->SetScaleAndSize(1.0f, bounds_.size());
+}
+
+ui::Compositor* TestCompositorHostOzone::GetCompositor() {
+ return compositor_.get();
+}
+
+void TestCompositorHostOzone::Draw() {
+ if (compositor_.get())
+ compositor_->Draw();
+}
+
+// static
+TestCompositorHost* TestCompositorHost::Create(const gfx::Rect& bounds) {
+ return new TestCompositorHostOzone(bounds);
+}
+
+} // namespace ui
diff --git a/chromium/ui/events/event.cc b/chromium/ui/events/event.cc
index 39d2b9a57f9..246e39721f2 100644
--- a/chromium/ui/events/event.cc
+++ b/chromium/ui/events/event.cc
@@ -273,13 +273,7 @@ void LocatedEvent::UpdateForRootTransform(
MouseEvent::MouseEvent(const base::NativeEvent& native_event)
: LocatedEvent(native_event),
changed_button_flags_(
-// GetChangedMouseButtonFlagsFromNative isn't implemented on Mac. MouseEvent shouldn't be used.
-#if !defined(OS_MACOSX)
- GetChangedMouseButtonFlagsFromNative(native_event)
-#else
- 0
-#endif
- ) {
+ GetChangedMouseButtonFlagsFromNative(native_event)) {
if (type() == ET_MOUSE_PRESSED || type() == ET_MOUSE_RELEASED)
SetClickCount(GetRepeatCount(*this));
}
@@ -644,8 +638,6 @@ void TranslatedKeyEvent::ConvertToKeyEvent() {
ScrollEvent::ScrollEvent(const base::NativeEvent& native_event)
: MouseEvent(native_event) {
-// GetScrollOffsets and GetFlingData aren't implemented on Mac. ScrollEvent shouldn't be used.
-#if !defined(OS_MACOSX)
if (type() == ET_SCROLL) {
GetScrollOffsets(native_event,
&x_offset_, &y_offset_,
@@ -657,9 +649,7 @@ ScrollEvent::ScrollEvent(const base::NativeEvent& native_event)
&x_offset_, &y_offset_,
&x_offset_ordinal_, &y_offset_ordinal_,
NULL);
- } else
-#endif
- {
+ } else {
NOTREACHED() << "Unexpected event type " << type()
<< " when constructing a ScrollEvent.";
}
diff --git a/chromium/ui/gl/gl_share_group.cc b/chromium/ui/gl/gl_share_group.cc
index 347873dc3ab..8e8958b49a4 100644
--- a/chromium/ui/gl/gl_share_group.cc
+++ b/chromium/ui/gl/gl_share_group.cc
@@ -18,9 +18,6 @@ GLShareGroup::GLShareGroup()
}
void GLShareGroup::AddContext(GLContext* context) {
- if (contexts_.empty())
- AboutToAddFirstContext();
-
contexts_.insert(context);
}
diff --git a/chromium/ui/gl/gl_share_group.h b/chromium/ui/gl/gl_share_group.h
index f1b03690f34..1deed63c541 100644
--- a/chromium/ui/gl/gl_share_group.h
+++ b/chromium/ui/gl/gl_share_group.h
@@ -31,7 +31,7 @@ class GL_EXPORT GLShareGroup : public base::RefCounted<GLShareGroup> {
// Returns a pointer to any initialized context in the share group
// or NULL if there are no initialized contexts in the share group.
- virtual GLContext* GetContext();
+ GLContext* GetContext();
// Sets and returns the unique shared GL context. Used for context
// virtualization.
@@ -45,13 +45,10 @@ class GL_EXPORT GLShareGroup : public base::RefCounted<GLShareGroup> {
int GetRendererID();
#endif
- protected:
- virtual ~GLShareGroup();
- virtual void AboutToAddFirstContext() { }
-
private:
friend class base::RefCounted<GLShareGroup>;
+ ~GLShareGroup();
// References to GLContext are by raw pointer to avoid a reference count
// cycle.
diff --git a/chromium/ui/ui.gyp b/chromium/ui/ui.gyp
index aa0f3be2fb6..5d61dc44043 100644
--- a/chromium/ui/ui.gyp
+++ b/chromium/ui/ui.gyp
@@ -350,7 +350,7 @@
],
},
}],
- ['toolkit_views==1 or use_qt==1', {
+ ['toolkit_views==1', {
'dependencies': [
'events/events.gyp:events',
],