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> |
11 } | 11 } |
12 | 12 |
13 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "chrome/common/chrome_notification_types.h" | 16 #include "chrome/common/chrome_notification_types.h" |
17 #include "content/common/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
18 #include "ui/base/x/x11_util.h" | 18 #include "ui/base/x/x11_util.h" |
19 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
20 | 20 |
21 using std::map; | 21 using std::map; |
22 using std::string; | 22 using std::string; |
23 | 23 |
24 namespace chromeos { | 24 namespace chromeos { |
25 | 25 |
26 namespace { | 26 namespace { |
27 | 27 |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 SendMessage(msg); | 296 SendMessage(msg); |
297 } | 297 } |
298 | 298 |
299 void WmIpc::FetchLayoutModeProperty() { | 299 void WmIpc::FetchLayoutModeProperty() { |
300 int value = 0; | 300 int value = 0; |
301 if (ui::GetIntProperty( | 301 if (ui::GetIntProperty( |
302 gdk_x11_get_default_root_xwindow(), | 302 gdk_x11_get_default_root_xwindow(), |
303 GetAtomName(ATOM_CHROME_LAYOUT_MODE), | 303 GetAtomName(ATOM_CHROME_LAYOUT_MODE), |
304 &value)) { | 304 &value)) { |
305 layout_mode_ = static_cast<WmIpcLayoutMode>(value); | 305 layout_mode_ = static_cast<WmIpcLayoutMode>(value); |
306 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 |