| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS 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 "window_manager/atom_cache.h" | 5 #include "window_manager/atom_cache.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chromeos/obsolete_logging.h" | 8 #include "chromeos/obsolete_logging.h" |
| 9 | 9 |
| 10 #include "window_manager/util.h" | 10 #include "window_manager/util.h" |
| 11 #include "window_manager/x_connection.h" | 11 #include "window_manager/x_connection.h" |
| 12 | 12 |
| 13 namespace chromeos { | 13 namespace window_manager { |
| 14 | 14 |
| 15 // A value from the Atom enum and the actual name that should be used to | 15 // A value from the Atom enum and the actual name that should be used to |
| 16 // look up its ID on the X server. | 16 // look up its ID on the X server. |
| 17 struct AtomInfo { | 17 struct AtomInfo { |
| 18 Atom atom; | 18 Atom atom; |
| 19 const char* name; | 19 const char* name; |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 // Each value from the Atom enum must be present here. | 22 // Each value from the Atom enum must be present here. |
| 23 static const AtomInfo kAtomInfos[] = { | 23 static const AtomInfo kAtomInfos[] = { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 std::string name; | 97 std::string name; |
| 98 if (!xconn_->GetAtomName(xatom, &name)) { | 98 if (!xconn_->GetAtomName(xatom, &name)) { |
| 99 LOG(ERROR) << "Unable to look up name for atom " << XidStr(xatom); | 99 LOG(ERROR) << "Unable to look up name for atom " << XidStr(xatom); |
| 100 static const std::string kEmptyName = ""; | 100 static const std::string kEmptyName = ""; |
| 101 return kEmptyName; | 101 return kEmptyName; |
| 102 } | 102 } |
| 103 return xatom_to_string_.insert(make_pair(xatom, name)).first->second; | 103 return xatom_to_string_.insert(make_pair(xatom, name)).first->second; |
| 104 } | 104 } |
| 105 | 105 |
| 106 }; | 106 }; |
| OLD | NEW |