| 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/base/cursor/cursor_loader_win.h" | 5 #include "ui/base/cursor/cursor_loader_win.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "ui/base/cursor/cursor.h" | 9 #include "ui/base/cursor/cursor.h" |
| 10 #include "ui/resources/grit/ui_unscaled_resources.h" | 10 #include "ui/resources/grit/ui_unscaled_resources.h" |
| 11 | 11 |
| 12 namespace ui { | 12 namespace ui { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 base::LazyInstance<base::string16> g_cursor_resource_module_name; | 16 base::LazyInstance<base::string16>::DestructorAtExit |
| 17 g_cursor_resource_module_name; |
| 17 | 18 |
| 18 const wchar_t* GetCursorId(gfx::NativeCursor native_cursor) { | 19 const wchar_t* GetCursorId(gfx::NativeCursor native_cursor) { |
| 19 switch (native_cursor.native_type()) { | 20 switch (native_cursor.native_type()) { |
| 20 case kCursorNull: | 21 case kCursorNull: |
| 21 return IDC_ARROW; | 22 return IDC_ARROW; |
| 22 case kCursorPointer: | 23 case kCursorPointer: |
| 23 return IDC_ARROW; | 24 return IDC_ARROW; |
| 24 case kCursorCross: | 25 case kCursorCross: |
| 25 return IDC_CROSS; | 26 return IDC_CROSS; |
| 26 case kCursorHand: | 27 case kCursorHand: |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 160 } |
| 160 } | 161 } |
| 161 | 162 |
| 162 // static | 163 // static |
| 163 void CursorLoaderWin::SetCursorResourceModule( | 164 void CursorLoaderWin::SetCursorResourceModule( |
| 164 const base::string16& module_name) { | 165 const base::string16& module_name) { |
| 165 g_cursor_resource_module_name.Get() = module_name; | 166 g_cursor_resource_module_name.Get() = module_name; |
| 166 } | 167 } |
| 167 | 168 |
| 168 } // namespace ui | 169 } // namespace ui |
| OLD | NEW |