tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

full_screen_application_handler.h (2404B)


      1 /*
      2 *  Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
      3 *
      4 *  Use of this source code is governed by a BSD-style license
      5 *  that can be found in the LICENSE file in the root of the source
      6 *  tree. An additional intellectual property rights grant can be found
      7 *  in the file PATENTS.  All contributing project authors may
      8 *  be found in the AUTHORS file in the root of the source tree.
      9 */
     10 
     11 #ifndef MODULES_DESKTOP_CAPTURE_FULL_SCREEN_APPLICATION_HANDLER_H_
     12 #define MODULES_DESKTOP_CAPTURE_FULL_SCREEN_APPLICATION_HANDLER_H_
     13 
     14 #include <cstdint>
     15 
     16 #include "modules/desktop_capture/desktop_capturer.h"
     17 
     18 namespace webrtc {
     19 
     20 // Base class for application specific handler to check criteria for switch to
     21 // full-screen mode and find if possible the full-screen window to share.
     22 // Supposed to be created and owned by platform specific
     23 // FullScreenWindowDetector.
     24 class FullScreenApplicationHandler {
     25 public:
     26  virtual ~FullScreenApplicationHandler() {}
     27 
     28  FullScreenApplicationHandler(const FullScreenApplicationHandler&) = delete;
     29  FullScreenApplicationHandler& operator=(const FullScreenApplicationHandler&) =
     30      delete;
     31 
     32  explicit FullScreenApplicationHandler(DesktopCapturer::SourceId sourceId);
     33 
     34  // Returns the full-screen window in place of the original window if all the
     35  // criteria are met, or 0 if no such window found.
     36  virtual DesktopCapturer::SourceId FindFullScreenWindow(
     37      const DesktopCapturer::SourceList& window_list,
     38      int64_t timestamp) const;
     39 
     40  // Returns source id of original window associated with
     41  // FullScreenApplicationHandler
     42  DesktopCapturer::SourceId GetSourceId() const;
     43 
     44  void SetUseHeuristicFullscreenPowerPointWindows(
     45      bool use_heuristic_fullscreen_powerpoint_windows) {
     46    use_heuristic_fullscreen_powerpoint_windows_ =
     47        use_heuristic_fullscreen_powerpoint_windows;
     48  }
     49 
     50  bool UseHeuristicFullscreenPowerPointWindows() const {
     51    return use_heuristic_fullscreen_powerpoint_windows_;
     52  }
     53 
     54  virtual void SetSlideShowCreationStateForTest(
     55      bool fullscreen_slide_show_started_after_capture_start) {}
     56 
     57 private:
     58  // `use_heuristic_fullscreen_powerpoint_windows_` is used to implement a
     59  // killswitch.
     60  bool use_heuristic_fullscreen_powerpoint_windows_ = true;
     61  const DesktopCapturer::SourceId source_id_;
     62 };
     63 
     64 }  // namespace webrtc
     65 
     66 #endif  // MODULES_DESKTOP_CAPTURE_FULL_SCREEN_APPLICATION_HANDLER_H_