OLD | NEW |
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 #ifndef CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ | 5 #ifndef CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ |
6 #define CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ | 6 #define CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 // add/remove events. Note that Output add/remove events are sent in response | 371 // add/remove events. Note that Output add/remove events are sent in response |
372 // to our own reconfiguration operations so spurious events are common. | 372 // to our own reconfiguration operations so spurious events are common. |
373 // Spurious events will have no effect. | 373 // Spurious events will have no effect. |
374 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; | 374 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; |
375 | 375 |
376 // Overridden from base::MessagePumpObserver: | 376 // Overridden from base::MessagePumpObserver: |
377 virtual base::EventStatus WillProcessEvent( | 377 virtual base::EventStatus WillProcessEvent( |
378 const base::NativeEvent& event) OVERRIDE; | 378 const base::NativeEvent& event) OVERRIDE; |
379 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE; | 379 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE; |
380 | 380 |
| 381 // Called when a screen sharing session is started or stopped. |
| 382 void OnScreenSharingStateChanged(bool started); |
| 383 |
381 void AddObserver(Observer* observer); | 384 void AddObserver(Observer* observer); |
382 void RemoveObserver(Observer* observer); | 385 void RemoveObserver(Observer* observer); |
383 | 386 |
384 // Sets all the displays into pre-suspend mode; usually this means | 387 // Sets all the displays into pre-suspend mode; usually this means |
385 // configure them for their resume state. This allows faster resume on | 388 // configure them for their resume state. This allows faster resume on |
386 // machines where display configuration is slow. | 389 // machines where display configuration is slow. |
387 void SuspendDisplays(); | 390 void SuspendDisplays(); |
388 | 391 |
389 // Reprobes displays to handle changes made while the system was | 392 // Reprobes displays to handle changes made while the system was |
390 // suspended. | 393 // suspended. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 int frame_buffer_height); | 498 int frame_buffer_height); |
496 | 499 |
497 // Returns the ratio between mirrored mode area and native mode area: | 500 // Returns the ratio between mirrored mode area and native mode area: |
498 // (mirror_mode_width * mirrow_mode_height) / (native_width * native_height) | 501 // (mirror_mode_width * mirrow_mode_height) / (native_width * native_height) |
499 float GetMirroredDisplayAreaRatio( | 502 float GetMirroredDisplayAreaRatio( |
500 const OutputConfigurator::OutputSnapshot& output); | 503 const OutputConfigurator::OutputSnapshot& output); |
501 | 504 |
502 // Applies output protections according to requests. | 505 // Applies output protections according to requests. |
503 bool ApplyProtections(const DisplayProtections& requests); | 506 bool ApplyProtections(const DisplayProtections& requests); |
504 | 507 |
| 508 // Sends the current projecting state to power manager. |
| 509 void SendProjectingStateToPowerManager(); |
| 510 |
505 StateController* state_controller_; | 511 StateController* state_controller_; |
506 SoftwareMirroringController* mirroring_controller_; | 512 SoftwareMirroringController* mirroring_controller_; |
507 scoped_ptr<Delegate> delegate_; | 513 scoped_ptr<Delegate> delegate_; |
508 | 514 |
509 // Used to enable modes which rely on panel fitting. | 515 // Used to enable modes which rely on panel fitting. |
510 bool is_panel_fitting_enabled_; | 516 bool is_panel_fitting_enabled_; |
511 | 517 |
512 // Key of the map is the touch display's id, and the value of the map is the | 518 // Key of the map is the touch display's id, and the value of the map is the |
513 // touch display's area ratio in mirror mode defined as : | 519 // touch display's area ratio in mirror mode defined as : |
514 // mirror_mode_area / native_mode_area. | 520 // mirror_mode_area / native_mode_area. |
(...skipping 28 matching lines...) Expand all Loading... |
543 // The timer to delay configuring outputs. See also the comments in | 549 // The timer to delay configuring outputs. See also the comments in |
544 // Dispatch(). | 550 // Dispatch(). |
545 scoped_ptr<base::OneShotTimer<OutputConfigurator> > configure_timer_; | 551 scoped_ptr<base::OneShotTimer<OutputConfigurator> > configure_timer_; |
546 | 552 |
547 // Id for next output protection client. | 553 // Id for next output protection client. |
548 OutputProtectionClientId next_output_protection_client_id_; | 554 OutputProtectionClientId next_output_protection_client_id_; |
549 | 555 |
550 // Output protection requests of each client. | 556 // Output protection requests of each client. |
551 ProtectionRequests client_protection_requests_; | 557 ProtectionRequests client_protection_requests_; |
552 | 558 |
| 559 // Number of outstanding screen sharing sessions. |
| 560 int screen_sharing_count_; |
| 561 |
553 DISALLOW_COPY_AND_ASSIGN(OutputConfigurator); | 562 DISALLOW_COPY_AND_ASSIGN(OutputConfigurator); |
554 }; | 563 }; |
555 | 564 |
556 typedef std::vector<OutputConfigurator::OutputSnapshot> OutputSnapshotList; | 565 typedef std::vector<OutputConfigurator::OutputSnapshot> OutputSnapshotList; |
557 | 566 |
558 } // namespace chromeos | 567 } // namespace chromeos |
559 | 568 |
560 #endif // CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ | 569 #endif // CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ |
OLD | NEW |