| 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 "chrome/browser/chromeos/wm_ipc.h" | 5 #include "chrome/browser/chromeos/wm_ipc.h" |
| 6 | 6 |
| 7 #include <gdk/gdkx.h> | 7 #include <gdk/gdkx.h> |
| 8 extern "C" { | 8 extern "C" { |
| 9 #include <X11/Xatom.h> | 9 #include <X11/Xatom.h> |
| 10 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 32, // size in bits of items in 'value' | 67 32, // size in bits of items in 'value' |
| 68 PropModeReplace, | 68 PropModeReplace, |
| 69 reinterpret_cast<const unsigned char*>(data.get()), | 69 reinterpret_cast<const unsigned char*>(data.get()), |
| 70 values.size()); // num items | 70 values.size()); // num items |
| 71 XFlush(ui::GetXDisplay()); | 71 XFlush(ui::GetXDisplay()); |
| 72 return true; | 72 return true; |
| 73 } | 73 } |
| 74 | 74 |
| 75 } // namespace | 75 } // namespace |
| 76 | 76 |
| 77 static base::LazyInstance<WmIpc> g_wm_ipc(base::LINKER_INITIALIZED); | 77 static base::LazyInstance<WmIpc> g_wm_ipc = LAZY_INSTANCE_INITIALIZER; |
| 78 | 78 |
| 79 // static | 79 // static |
| 80 WmIpc* WmIpc::instance() { | 80 WmIpc* WmIpc::instance() { |
| 81 return g_wm_ipc.Pointer(); | 81 return g_wm_ipc.Pointer(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 string WmIpc::GetAtomName(AtomType type) const { | 84 string WmIpc::GetAtomName(AtomType type) const { |
| 85 map<AtomType, Atom>::const_iterator atom_it = type_to_atom_.find(type); | 85 map<AtomType, Atom>::const_iterator atom_it = type_to_atom_.find(type); |
| 86 DCHECK(atom_it != type_to_atom_.end()) << "Unknown AtomType " << type; | 86 DCHECK(atom_it != type_to_atom_.end()) << "Unknown AtomType " << type; |
| 87 if (atom_it == type_to_atom_.end()) | 87 if (atom_it == type_to_atom_.end()) |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 content::NotificationService::current()->Notify( | 306 content::NotificationService::current()->Notify( |
| 307 chrome::NOTIFICATION_LAYOUT_MODE_CHANGED, | 307 chrome::NOTIFICATION_LAYOUT_MODE_CHANGED, |
| 308 content::Source<WmIpc>(this), | 308 content::Source<WmIpc>(this), |
| 309 content::Details<WmIpcLayoutMode>(&layout_mode_)); | 309 content::Details<WmIpcLayoutMode>(&layout_mode_)); |
| 310 } else { | 310 } else { |
| 311 DLOG(WARNING) << "Missing _CHROME_LAYOUT_MODE property on root window"; | 311 DLOG(WARNING) << "Missing _CHROME_LAYOUT_MODE property on root window"; |
| 312 } | 312 } |
| 313 } | 313 } |
| 314 | 314 |
| 315 } // namespace chromeos | 315 } // namespace chromeos |
| OLD | NEW |