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

Side by Side Diff: chromeos/display/output_configurator.cc

Issue 10986087: Adds DisplayErrorDialog to show the error message of the failure of mirroring to the users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
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 "chromeos/display/output_configurator.h" 5 #include "chromeos/display/output_configurator.h"
6 6
7 #include <X11/Xlib.h> 7 #include <X11/Xlib.h>
8 #include <X11/extensions/dpms.h> 8 #include <X11/extensions/dpms.h>
9 #include <X11/extensions/Xrandr.h> 9 #include <X11/extensions/Xrandr.h>
10 10
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 733
734 return success; 734 return success;
735 } 735 }
736 736
737 bool OutputConfigurator::SetDisplayMode(OutputState new_state) { 737 bool OutputConfigurator::SetDisplayMode(OutputState new_state) {
738 if (output_state_ == STATE_INVALID || 738 if (output_state_ == STATE_INVALID ||
739 output_state_ == STATE_HEADLESS || 739 output_state_ == STATE_HEADLESS ||
740 output_state_ == STATE_SINGLE) 740 output_state_ == STATE_SINGLE)
741 return false; 741 return false;
742 742
743 if (output_state_ == new_state)
744 return true;
745
746 Display* display = base::MessagePumpAuraX11::GetDefaultXDisplay(); 743 Display* display = base::MessagePumpAuraX11::GetDefaultXDisplay();
747 CHECK(display != NULL); 744 CHECK(display != NULL);
748 XGrabServer(display); 745 XGrabServer(display);
749 Window window = DefaultRootWindow(display); 746 Window window = DefaultRootWindow(display);
750 XRRScreenResources* screen = GetScreenResourcesAndRecordUMA(display, window); 747 XRRScreenResources* screen = GetScreenResourcesAndRecordUMA(display, window);
751 CHECK(screen != NULL); 748 CHECK(screen != NULL);
752 749
753 bool did_change = false; 750 bool did_change = false;
754 OutputSnapshot outputs[2] = { {0}, {0} }; 751 OutputSnapshot outputs[2] = { {0}, {0} };
755 connected_output_count_ = 752 connected_output_count_ =
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 // distinguish internal display. 853 // distinguish internal display.
857 return false; 854 return false;
858 } 855 }
859 856
860 void OutputConfigurator::NotifyOnDisplayChanged() { 857 void OutputConfigurator::NotifyOnDisplayChanged() {
861 notification_timer_.reset(); 858 notification_timer_.reset();
862 FOR_EACH_OBSERVER(Observer, observers_, OnDisplayModeChanged()); 859 FOR_EACH_OBSERVER(Observer, observers_, OnDisplayModeChanged());
863 } 860 }
864 861
865 } // namespace chromeos 862 } // namespace chromeos
OLDNEW
« ash/display/display_error_dialog.cc ('K') | « ash/display/output_configurator_animation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698