File: null_capture_mode_session.cc

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (166 lines) | stat: -rw-r--r-- 5,235 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/capture_mode/null_capture_mode_session.h"
#include "base/notreached.h"
#include "ui/compositor/layer.h"

namespace ash {

NullCaptureModeSession::NullCaptureModeSession(
    CaptureModeController* controller,
    CaptureModeBehavior* active_behavior)
    : BaseCaptureModeSession(controller, active_behavior, SessionType::kReal) {}

views::Widget* NullCaptureModeSession::GetCaptureModeBarWidget() {
  // The null session will never have a bar widget, so this function should
  // never be called.
  NOTREACHED();
}

aura::Window* NullCaptureModeSession::GetSelectedWindow() const {
  CHECK_LE(selected_window_tracker_.windows().size(), 1u);
  return selected_window_tracker_.windows().size() == 1
             ? selected_window_tracker_.windows().front()
             : nullptr;
}

void NullCaptureModeSession::SetPreSelectedWindow(
    aura::Window* pre_selected_window) {
  selected_window_tracker_.Add(pre_selected_window);

  // A pre-selected window has just been set, which means the selfie camera (if
  // one is selected) can now be shown, and its parenting should be updated such
  // that it can be made a child of the pre-selected window.
  MaybeUpdateSelfieCamInSessionVisibility();
}

void NullCaptureModeSession::OnCaptureSourceChanged(
    CaptureModeSource new_source) {
  // Currently, the null session only applies to game dashboard, which only
  // records selected windows.
  if (new_source != CaptureModeSource::kWindow) {
    NOTREACHED();
  }
}

void NullCaptureModeSession::OnCaptureTypeChanged(CaptureModeType new_type) {
  MaybeUpdateSelfieCamInSessionVisibility();
}

void NullCaptureModeSession::OnRecordingTypeChanged() {}

void NullCaptureModeSession::OnAudioRecordingModeChanged() {
  active_behavior_->OnAudioRecordingModeChanged();
}

void NullCaptureModeSession::OnDemoToolsSettingsChanged() {
  active_behavior_->OnDemoToolsSettingsChanged();
}

void NullCaptureModeSession::OnWaitingForDlpConfirmationStarted() {}

void NullCaptureModeSession::OnWaitingForDlpConfirmationEnded(bool reshow_uis) {
}

void NullCaptureModeSession::ReportSessionHistograms() {
  RecordCaptureModeConfiguration(
      controller_->type(), controller_->source(), controller_->recording_type(),
      controller_->GetEffectiveAudioRecordingMode(), active_behavior_);
}

void NullCaptureModeSession::StartCountDown(
    base::OnceClosure countdown_finished_callback) {
  // Skip the countdown as we are aiming to record immediately.
  std::move(countdown_finished_callback).Run();
}

void NullCaptureModeSession::OnCaptureFolderMayHaveChanged() {
  NOTREACHED();
}

void NullCaptureModeSession::OnDefaultCaptureFolderSelectionChanged() {
  NOTREACHED();
}

bool NullCaptureModeSession::CalculateCameraPreviewTargetVisibility() const {
  return true;
}

void NullCaptureModeSession::OnCameraPreviewDragStarted() {}

void NullCaptureModeSession::OnCameraPreviewDragEnded(
    const gfx::Point& screen_location,
    bool is_touch) {}

void NullCaptureModeSession::OnCameraPreviewBoundsOrVisibilityChanged(
    bool capture_surface_became_too_small,
    bool did_bounds_or_visibility_change) {}

void NullCaptureModeSession::OnCameraPreviewDestroyed() {}

void NullCaptureModeSession::MaybeDismissSunfishRegionNudgeForever() {}

void NullCaptureModeSession::MaybeChangeRoot(aura::Window* new_root,
                                             bool root_window_will_shutdown) {
  DCHECK(new_root->IsRootWindow());
  current_root_ = new_root;
}

std::set<aura::Window*>
NullCaptureModeSession::GetWindowsToIgnoreFromWidgets() {
  return std::set<aura::Window*>();
}

void NullCaptureModeSession::OnPerformCaptureForSearchStarting(
    PerformCaptureType capture_type) {}

void NullCaptureModeSession::OnPerformCaptureForSearchEnded(
    PerformCaptureType capture_type) {}

base::WeakPtr<BaseCaptureModeSession>
NullCaptureModeSession::GetImageSearchToken() {
  return nullptr;
}

ActionButtonView* NullCaptureModeSession::AddActionButton(
    views::Button::PressedCallback callback,
    std::u16string text,
    const gfx::VectorIcon* icon,
    const ActionButtonRank rank,
    ActionButtonViewID id) {
  return nullptr;
}

void NullCaptureModeSession::AddSmartActionsButton() {}

void NullCaptureModeSession::MaybeShowScannerDisclaimer(
    ScannerEntryPoint entry_point,
    base::RepeatingClosure accept_callback,
    base::RepeatingClosure decline_callback) {}

void NullCaptureModeSession::OnScannerActionsFetched(
    ScannerSession::FetchActionsResponse actions_response) {}

void NullCaptureModeSession::ShowActionContainerError(
    const std::u16string& error_message) {}

void NullCaptureModeSession::InitInternal() {
  layer()->SetName("NullCaptureModeSession");
}

void NullCaptureModeSession::ShutdownInternal() {}

void NullCaptureModeSession::OnSearchResultsPanelCreated(
    views::Widget* panel_widget) {}

bool NullCaptureModeSession::TakeFocusForSearchResultsPanel(bool reverse) {
  return false;
}

void NullCaptureModeSession::ClearPseudoFocus() {}

void NullCaptureModeSession::SetA11yOverrideWindowToSearchResultsPanel() {}

}  // namespace ash