| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/view.h" | 5 #include "ui/views/view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "ui/views/accessibility/native_view_accessibility_win.h" | 38 #include "ui/views/accessibility/native_view_accessibility_win.h" |
| 39 #endif | 39 #endif |
| 40 #if defined(TOOLKIT_USES_GTK) | 40 #if defined(TOOLKIT_USES_GTK) |
| 41 #include "ui/base/gtk/scoped_handle_gtk.h" | 41 #include "ui/base/gtk/scoped_handle_gtk.h" |
| 42 #endif | 42 #endif |
| 43 | 43 |
| 44 namespace { | 44 namespace { |
| 45 | 45 |
| 46 // Whether to use accelerated compositing when necessary (e.g. when a view has a | 46 // Whether to use accelerated compositing when necessary (e.g. when a view has a |
| 47 // transformation). | 47 // transformation). |
| 48 #if defined(VIEWS_COMPOSITOR) | 48 #if defined(USE_AURA) |
| 49 bool use_acceleration_when_possible = true; | 49 bool use_acceleration_when_possible = true; |
| 50 #else | 50 #else |
| 51 bool use_acceleration_when_possible = false; | 51 bool use_acceleration_when_possible = false; |
| 52 #endif | 52 #endif |
| 53 | 53 |
| 54 // Saves the drawing state, and restores the state when going out of scope. | 54 // Saves the drawing state, and restores the state when going out of scope. |
| 55 class ScopedCanvas { | 55 class ScopedCanvas { |
| 56 public: | 56 public: |
| 57 explicit ScopedCanvas(gfx::Canvas* canvas) : canvas_(canvas) { | 57 explicit ScopedCanvas(gfx::Canvas* canvas) : canvas_(canvas) { |
| 58 if (canvas_) | 58 if (canvas_) |
| (...skipping 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2059 OSExchangeData data; | 2059 OSExchangeData data; |
| 2060 WriteDragData(press_pt, &data); | 2060 WriteDragData(press_pt, &data); |
| 2061 | 2061 |
| 2062 // Message the RootView to do the drag and drop. That way if we're removed | 2062 // Message the RootView to do the drag and drop. That way if we're removed |
| 2063 // the RootView can detect it and avoid calling us back. | 2063 // the RootView can detect it and avoid calling us back. |
| 2064 GetWidget()->RunShellDrag(this, data, drag_operations); | 2064 GetWidget()->RunShellDrag(this, data, drag_operations); |
| 2065 #endif // !defined(OS_MACOSX) | 2065 #endif // !defined(OS_MACOSX) |
| 2066 } | 2066 } |
| 2067 | 2067 |
| 2068 } // namespace views | 2068 } // namespace views |
| OLD | NEW |