Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/metrics.h" | 5 #include "views/metrics.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| 11 namespace { | |
| 12 // Default double click interval in milliseconds. | |
|
sky
2011/11/10 21:37:03
nit: newline between 11 and 12.
jennyz
2011/11/10 21:47:25
Done.
| |
| 13 // Use the default double click interval value on gtk. | |
| 14 const int kDefaultDoubleClickInterval = 500; | |
| 15 | |
| 16 } // namespace | |
| 17 | |
| 11 namespace views { | 18 namespace views { |
| 12 | 19 |
| 13 int GetDoubleClickInterval() { | 20 int GetDoubleClickInterval() { |
| 14 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
| 15 return ::GetDoubleClickTime(); | 22 return ::GetDoubleClickTime(); |
| 16 #else | 23 #else |
| 17 return 5; | 24 // TODO(jennyz): This value may need to be adjusted on different platforms. |
| 25 return kDefaultDoubleClickInterval; | |
| 18 #endif | 26 #endif |
| 19 } | 27 } |
| 20 | 28 |
| 21 int GetMenuShowDelay() { | 29 int GetMenuShowDelay() { |
| 22 #if defined(OS_WIN) | 30 #if defined(OS_WIN) |
| 23 static DWORD delay = 0; | 31 static DWORD delay = 0; |
| 24 if (!delay && !SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &delay, 0)) | 32 if (!delay && !SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &delay, 0)) |
| 25 delay = kDefaultMenuShowDelay; | 33 delay = kDefaultMenuShowDelay; |
| 26 return delay; | 34 return delay; |
| 27 #else | 35 #else |
| 28 return 0; | 36 return 0; |
| 29 #endif | 37 #endif |
| 30 } | 38 } |
| 31 | 39 |
| 32 } // namespace views | 40 } // namespace views |
| OLD | NEW |