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

Side by Side Diff: ui/display/chromeos/x11/native_display_delegate_x11.cc

Issue 2422073002: Reduce FOR_EACH_OBSERVER usage in ui/ (Closed)
Patch Set: remove space 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/display/chromeos/display_configurator.cc ('k') | ui/display/display_change_notifier.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/display/chromeos/x11/native_display_delegate_x11.h" 5 #include "ui/display/chromeos/x11/native_display_delegate_x11.h"
6 6
7 #include <X11/Xatom.h> 7 #include <X11/Xatom.h>
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 #include <X11/extensions/dpms.h> 9 #include <X11/extensions/dpms.h>
10 #include <X11/extensions/Xrandr.h> 10 #include <X11/extensions/Xrandr.h>
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 ~HelperDelegateX11() override {} 83 ~HelperDelegateX11() override {}
84 84
85 // NativeDisplayDelegateX11::HelperDelegate overrides: 85 // NativeDisplayDelegateX11::HelperDelegate overrides:
86 void UpdateXRandRConfiguration(const base::NativeEvent& event) override { 86 void UpdateXRandRConfiguration(const base::NativeEvent& event) override {
87 XRRUpdateConfiguration(event); 87 XRRUpdateConfiguration(event);
88 } 88 }
89 const std::vector<DisplaySnapshot*>& GetCachedDisplays() const override { 89 const std::vector<DisplaySnapshot*>& GetCachedDisplays() const override {
90 return delegate_->cached_outputs_.get(); 90 return delegate_->cached_outputs_.get();
91 } 91 }
92 void NotifyDisplayObservers() override { 92 void NotifyDisplayObservers() override {
93 FOR_EACH_OBSERVER( 93 for (NativeDisplayObserver& observer : delegate_->observers_)
94 NativeDisplayObserver, delegate_->observers_, OnConfigurationChanged()); 94 observer.OnConfigurationChanged();
95 } 95 }
96 96
97 private: 97 private:
98 NativeDisplayDelegateX11* delegate_; 98 NativeDisplayDelegateX11* delegate_;
99 99
100 DISALLOW_COPY_AND_ASSIGN(HelperDelegateX11); 100 DISALLOW_COPY_AND_ASSIGN(HelperDelegateX11);
101 }; 101 };
102 102
103 //////////////////////////////////////////////////////////////////////////////// 103 ////////////////////////////////////////////////////////////////////////////////
104 // NativeDisplayDelegateX11 implementation: 104 // NativeDisplayDelegateX11 implementation:
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 XSetForeground(display_, gc, color.pixel); 655 XSetForeground(display_, gc, color.pixel);
656 XSetFillStyle(display_, gc, FillSolid); 656 XSetFillStyle(display_, gc, FillSolid);
657 int width = DisplayWidth(display_, DefaultScreen(display_)); 657 int width = DisplayWidth(display_, DefaultScreen(display_));
658 int height = DisplayHeight(display_, DefaultScreen(display_)); 658 int height = DisplayHeight(display_, DefaultScreen(display_));
659 XFillRectangle(display_, window_, gc, 0, 0, width, height); 659 XFillRectangle(display_, window_, gc, 0, 0, width, height);
660 XFreeGC(display_, gc); 660 XFreeGC(display_, gc);
661 XFreeColors(display_, colormap, &color.pixel, 1, 0); 661 XFreeColors(display_, colormap, &color.pixel, 1, 0);
662 } 662 }
663 663
664 } // namespace ui 664 } // namespace ui
OLDNEW
« no previous file with comments | « ui/display/chromeos/display_configurator.cc ('k') | ui/display/display_change_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698