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

Unified Diff: views/widget/native_widget_view.cc

Issue 7065042: Hook up more of the NativeWidgetViews. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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: views/widget/native_widget_view.cc
===================================================================
--- views/widget/native_widget_view.cc (revision 0)
+++ views/widget/native_widget_view.cc (revision 0)
@@ -0,0 +1,108 @@
+// Copyright (c) 2011 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 "views/widget/native_widget_view.h"
+
+#include "ui/gfx/canvas.h"
+
+namespace views {
+namespace internal {
+
+////////////////////////////////////////////////////////////////////////////////
+// NativeWidgetView, public:
+
+NativeWidgetView::NativeWidgetView(NativeWidgetViews* native_widget)
+ : native_widget_(native_widget) {
+}
+
+NativeWidgetView::~NativeWidgetView() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// NativeWidgetView, View overrides:
+
+void NativeWidgetView::ViewHierarchyChanged(bool is_add, View* parent,
+ View* child) {
+ if (is_add && child == this)
+ delegate()->OnNativeWidgetCreated();
+}
+
+void NativeWidgetView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
+ delegate()->OnSizeChanged(size());
+}
+
+void NativeWidgetView::OnPaint(gfx::Canvas* canvas) {
+ canvas->FillRectInt(SK_ColorRED, 0, 0, width(), height());
+ delegate()->OnNativeWidgetPaint(canvas);
+}
+
+bool NativeWidgetView::OnMousePressed(const MouseEvent& event) {
+ MouseEvent e(event, this);
+ return delegate()->OnMouseEvent(event);
+}
+
+bool NativeWidgetView::OnMouseDragged(const MouseEvent& event) {
+ MouseEvent e(event, this);
+ return delegate()->OnMouseEvent(event);
+}
+
+void NativeWidgetView::OnMouseReleased(const MouseEvent& event) {
+ MouseEvent e(event, this);
+ delegate()->OnMouseEvent(event);
+}
+
+void NativeWidgetView::OnMouseCaptureLost() {
+ delegate()->OnMouseCaptureLost();
+}
+
+void NativeWidgetView::OnMouseMoved(const MouseEvent& event) {
+ MouseEvent e(event, this);
+ delegate()->OnMouseEvent(event);
+}
+
+void NativeWidgetView::OnMouseEntered(const MouseEvent& event) {
+ MouseEvent e(event, this);
+ delegate()->OnMouseEvent(event);
+}
+
+void NativeWidgetView::OnMouseExited(const MouseEvent& event) {
+ MouseEvent e(event, this);
+ delegate()->OnMouseEvent(event);
+}
+
+#if defined(TOUCH_UI)
+View::TouchStatus NativeWidgetView::OnTouchEvent(const TouchEvent& event) {
+ NOTIMPLEMENTED();
+ // TODO(beng): TouchEvents don't go through the Widget right now... so we
+ // can't just pass them to the delegate...
+ return TOUCH_STATUS_UNKNOWN;
+}
+#endif
+
+bool NativeWidgetView::OnKeyPressed(const KeyEvent& event) {
+ return delegate()->OnKeyEvent(event);
+}
+
+bool NativeWidgetView::OnKeyReleased(const KeyEvent& event) {
+ return delegate()->OnKeyEvent(event);
+}
+
+bool NativeWidgetView::OnMouseWheel(const MouseWheelEvent& event) {
+ MouseWheelEvent e(event, this);
+ return delegate()->OnMouseEvent(event);
+}
+
+void NativeWidgetView::OnFocus() {
+ // TODO(beng): check if we have to do this.
+ //delegate()->OnNativeFocus(NULL);
+}
+
+void NativeWidgetView::OnBlur() {
+ // TODO(beng): check if we have to do this.
+ //delegate()->OnNativeBlur(NULL);
+}
+
+} // namespace internal
+} // namespace views
+
Property changes on: views\widget\native_widget_view.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698