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

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

Issue 139053003: Chrome OS: avoid suspending on lid close when casting is active. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Oshima's suggestion. Created 6 years, 11 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 #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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 418
419 // Requests the desired protection methods. 419 // Requests the desired protection methods.
420 // |protection_mask| is the desired protection methods, which is a bitmask 420 // |protection_mask| is the desired protection methods, which is a bitmask
421 // of the OutputProtectionMethod values. 421 // of the OutputProtectionMethod values.
422 // Returns true when the protection request has been made. 422 // Returns true when the protection request has been made.
423 bool EnableOutputProtection( 423 bool EnableOutputProtection(
424 OutputProtectionClientId client_id, 424 OutputProtectionClientId client_id,
425 int64 display_id, 425 int64 display_id,
426 uint32_t desired_protection_mask); 426 uint32_t desired_protection_mask);
427 427
428 // Updates number of active screen sharing sessions.
429 void SetScreenSharingCount(int screen_sharing_count);
430
428 private: 431 private:
429 // Mapping a display_id to a protection request bitmask. 432 // Mapping a display_id to a protection request bitmask.
430 typedef std::map<int64, uint32_t> DisplayProtections; 433 typedef std::map<int64, uint32_t> DisplayProtections;
431 // Mapping a client to its protection request. 434 // Mapping a client to its protection request.
432 typedef std::map<OutputProtectionClientId, 435 typedef std::map<OutputProtectionClientId,
433 DisplayProtections> ProtectionRequests; 436 DisplayProtections> ProtectionRequests;
434 437
435 // Updates |cached_outputs_| to contain currently-connected outputs. Calls 438 // Updates |cached_outputs_| to contain currently-connected outputs. Calls
436 // |delegate_->GetOutputs()| and then does additional work, like finding the 439 // |delegate_->GetOutputs()| and then does additional work, like finding the
437 // mirror mode and setting user-preferred modes. Note that the server must be 440 // mirror mode and setting user-preferred modes. Note that the server must be
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Determines if we are projecting to an external display.
509 bool IsProjecting() const;
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698