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

Side by Side Diff: trunk/src/chromeos/ime/xkeyboard.cc

Issue 203313004: Revert 257618 "roll clang 198389:202554" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « trunk/src/build/config/compiler/BUILD.gn ('k') | trunk/src/third_party/libxml/libxml.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chromeos/ime/xkeyboard.h" 5 #include "chromeos/ime/xkeyboard.h"
6 6
7 #include <cstdlib> 7 #include <cstdlib>
8 #include <cstring> 8 #include <cstring>
9 #include <queue> 9 #include <queue>
10 #include <set> 10 #include <set>
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 unsigned int XKeyboardImpl::GetNumLockMask() { 146 unsigned int XKeyboardImpl::GetNumLockMask() {
147 DCHECK(thread_checker_.CalledOnValidThread()); 147 DCHECK(thread_checker_.CalledOnValidThread());
148 static const unsigned int kBadMask = 0; 148 static const unsigned int kBadMask = 0;
149 149
150 unsigned int real_mask = kBadMask; 150 unsigned int real_mask = kBadMask;
151 XkbDescPtr xkb_desc = 151 XkbDescPtr xkb_desc =
152 XkbGetKeyboard(GetXDisplay(), XkbAllComponentsMask, XkbUseCoreKbd); 152 XkbGetKeyboard(GetXDisplay(), XkbAllComponentsMask, XkbUseCoreKbd);
153 if (!xkb_desc) 153 if (!xkb_desc)
154 return kBadMask; 154 return kBadMask;
155 155
156 if (xkb_desc->dpy && xkb_desc->names /*TODO && xkb_desc->names->vmods*/) { 156 if (xkb_desc->dpy && xkb_desc->names && xkb_desc->names->vmods) {
157 const std::string string_to_find(kNumLockVirtualModifierString); 157 const std::string string_to_find(kNumLockVirtualModifierString);
158 for (size_t i = 0; i < XkbNumVirtualMods; ++i) { 158 for (size_t i = 0; i < XkbNumVirtualMods; ++i) {
159 const unsigned int virtual_mod_mask = 1U << i; 159 const unsigned int virtual_mod_mask = 1U << i;
160 char* virtual_mod_str_raw_ptr = 160 char* virtual_mod_str_raw_ptr =
161 XGetAtomName(xkb_desc->dpy, xkb_desc->names->vmods[i]); 161 XGetAtomName(xkb_desc->dpy, xkb_desc->names->vmods[i]);
162 if (!virtual_mod_str_raw_ptr) 162 if (!virtual_mod_str_raw_ptr)
163 continue; 163 continue;
164 const std::string virtual_mod_str = virtual_mod_str_raw_ptr; 164 const std::string virtual_mod_str = virtual_mod_str_raw_ptr;
165 XFree(virtual_mod_str_raw_ptr); 165 XFree(virtual_mod_str_raw_ptr);
166 166
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 return CheckLayoutName(layout_name); 370 return CheckLayoutName(layout_name);
371 } 371 }
372 372
373 // static 373 // static
374 XKeyboard* XKeyboard::Create() { 374 XKeyboard* XKeyboard::Create() {
375 return new XKeyboardImpl(); 375 return new XKeyboardImpl();
376 } 376 }
377 377
378 } // namespace input_method 378 } // namespace input_method
379 } // namespace chromeos 379 } // namespace chromeos
OLDNEW
« no previous file with comments | « trunk/src/build/config/compiler/BUILD.gn ('k') | trunk/src/third_party/libxml/libxml.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698