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

Side by Side Diff: ui/views/widget/desktop_aura/x11_desktop_handler.cc

Issue 2418983002: ui/views: convert usage of FOR_EACH_OBSERVER macro (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ('k') | ui/views/widget/widget.cc » ('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 (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/views/widget/desktop_aura/x11_desktop_handler.h" 5 #include "ui/views/widget/desktop_aura/x11_desktop_handler.h"
6 6
7 #include <X11/Xatom.h> 7 #include <X11/Xatom.h>
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 9
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 (event->type == PropertyNotify && 87 (event->type == PropertyNotify &&
88 event->xproperty.window == x_root_window_); 88 event->xproperty.window == x_root_window_);
89 } 89 }
90 90
91 uint32_t X11DesktopHandler::DispatchEvent(const ui::PlatformEvent& event) { 91 uint32_t X11DesktopHandler::DispatchEvent(const ui::PlatformEvent& event) {
92 switch (event->type) { 92 switch (event->type) {
93 case PropertyNotify: { 93 case PropertyNotify: {
94 if (event->xproperty.atom == 94 if (event->xproperty.atom ==
95 atom_cache_.GetAtom("_NET_CURRENT_DESKTOP")) { 95 atom_cache_.GetAtom("_NET_CURRENT_DESKTOP")) {
96 if (UpdateWorkspace()) { 96 if (UpdateWorkspace()) {
97 FOR_EACH_OBSERVER(views::X11DesktopHandlerObserver, observers_, 97 for (views::X11DesktopHandlerObserver& observer : observers_)
98 OnWorkspaceChanged(workspace_)); 98 observer.OnWorkspaceChanged(workspace_);
99 } 99 }
100 } 100 }
101 break; 101 break;
102 } 102 }
103 case CreateNotify: 103 case CreateNotify:
104 OnWindowCreatedOrDestroyed(event->type, event->xcreatewindow.window); 104 OnWindowCreatedOrDestroyed(event->type, event->xcreatewindow.window);
105 break; 105 break;
106 case DestroyNotify: 106 case DestroyNotify:
107 OnWindowCreatedOrDestroyed(event->type, event->xdestroywindow.window); 107 OnWindowCreatedOrDestroyed(event->type, event->xdestroywindow.window);
108 break; 108 break;
(...skipping 25 matching lines...) Expand all
134 // The window might be destroyed if the message pump did not get a chance to 134 // The window might be destroyed if the message pump did not get a chance to
135 // run but we can safely ignore the X error. 135 // run but we can safely ignore the X error.
136 gfx::X11ErrorTracker error_tracker; 136 gfx::X11ErrorTracker error_tracker;
137 ui::XMenuList::GetInstance()->MaybeRegisterMenu(window); 137 ui::XMenuList::GetInstance()->MaybeRegisterMenu(window);
138 } else { 138 } else {
139 ui::XMenuList::GetInstance()->MaybeUnregisterMenu(window); 139 ui::XMenuList::GetInstance()->MaybeUnregisterMenu(window);
140 } 140 }
141 } 141 }
142 142
143 } // namespace views 143 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698