Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef VIEWS_EVENT_H_ | 5 #ifndef VIEWS_EVENT_H_ |
| 6 #define VIEWS_EVENT_H_ | 6 #define VIEWS_EVENT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/time.h" | |
| 10 #include "gfx/point.h" | 11 #include "gfx/point.h" |
| 11 #include "ui/base/keycodes/keyboard_codes.h" | 12 #include "ui/base/keycodes/keyboard_codes.h" |
| 12 | 13 |
| 13 #if defined(OS_LINUX) | 14 #if defined(OS_LINUX) |
| 14 typedef struct _GdkEventKey GdkEventKey; | 15 typedef struct _GdkEventKey GdkEventKey; |
| 15 #endif | 16 #endif |
| 16 | 17 |
| 17 #if defined(TOUCH_UI) | 18 #if defined(TOUCH_UI) |
| 18 typedef union _XEvent XEvent; | 19 typedef union _XEvent XEvent; |
| 19 #endif | 20 #endif |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 EF_MIDDLE_BUTTON_DOWN = 1 << 5, | 74 EF_MIDDLE_BUTTON_DOWN = 1 << 5, |
| 74 EF_RIGHT_BUTTON_DOWN = 1 << 6, | 75 EF_RIGHT_BUTTON_DOWN = 1 << 6, |
| 75 EF_COMMAND_DOWN = 1 << 7, // Only useful on OSX | 76 EF_COMMAND_DOWN = 1 << 7, // Only useful on OSX |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 // Return the event type | 79 // Return the event type |
| 79 EventType GetType() const { | 80 EventType GetType() const { |
| 80 return type_; | 81 return type_; |
| 81 } | 82 } |
| 82 | 83 |
| 83 // Return the event time stamp in ticks | 84 // Return the event time stamp. |
| 84 int GetTimeStamp() const { | 85 base::Time GetTimeStamp() const { |
|
oshima
2011/01/18 19:52:54
const base::Time&
varunjain
2011/01/25 04:06:40
Done.
| |
| 85 return time_stamp_; | 86 return time_stamp_; |
| 86 } | 87 } |
| 87 | 88 |
| 88 // Return the flags | 89 // Return the flags |
| 89 int GetFlags() const { | 90 int GetFlags() const { |
| 90 return flags_; | 91 return flags_; |
| 91 } | 92 } |
| 92 | 93 |
| 93 void set_flags(int flags) { | 94 void set_flags(int flags) { |
| 94 flags_ = flags; | 95 flags_ = flags; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 Event(const Event& model) | 151 Event(const Event& model) |
| 151 : type_(model.GetType()), | 152 : type_(model.GetType()), |
| 152 time_stamp_(model.GetTimeStamp()), | 153 time_stamp_(model.GetTimeStamp()), |
| 153 flags_(model.GetFlags()) { | 154 flags_(model.GetFlags()) { |
| 154 } | 155 } |
| 155 | 156 |
| 156 private: | 157 private: |
| 157 void operator=(const Event&); | 158 void operator=(const Event&); |
| 158 | 159 |
| 159 EventType type_; | 160 EventType type_; |
| 160 int time_stamp_; | 161 base::Time time_stamp_; |
| 161 int flags_; | 162 int flags_; |
| 162 }; | 163 }; |
| 163 | 164 |
| 164 //////////////////////////////////////////////////////////////////////////////// | 165 //////////////////////////////////////////////////////////////////////////////// |
| 165 // | 166 // |
| 166 // LocatedEvent class | 167 // LocatedEvent class |
| 167 // | 168 // |
| 168 // A generic event that is used for any events that is located at a specific | 169 // A generic event that is used for any events that is located at a specific |
| 169 // position in the screen. | 170 // position in the screen. |
| 170 // | 171 // |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 448 private: | 449 private: |
| 449 const OSExchangeData& data_; | 450 const OSExchangeData& data_; |
| 450 int source_operations_; | 451 int source_operations_; |
| 451 | 452 |
| 452 DISALLOW_COPY_AND_ASSIGN(DropTargetEvent); | 453 DISALLOW_COPY_AND_ASSIGN(DropTargetEvent); |
| 453 }; | 454 }; |
| 454 | 455 |
| 455 } // namespace views | 456 } // namespace views |
| 456 | 457 |
| 457 #endif // VIEWS_EVENT_H_ | 458 #endif // VIEWS_EVENT_H_ |
| OLD | NEW |