refactor: use standard naming for enum class values (#38232)
This commit is contained in:
parent
88a9962e22
commit
0149ae72e6
5 changed files with 17 additions and 17 deletions
|
@ -1476,7 +1476,7 @@ void WebContents::OnEnterFullscreenModeForTab(
|
|||
}
|
||||
|
||||
owner_window()->set_fullscreen_transition_type(
|
||||
NativeWindow::FullScreenTransitionType::HTML);
|
||||
NativeWindow::FullScreenTransitionType::kHTML);
|
||||
exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab(
|
||||
requesting_frame, options.display_id);
|
||||
|
||||
|
@ -3846,9 +3846,9 @@ bool WebContents::IsFullscreenForTabOrPending(
|
|||
return is_html_fullscreen();
|
||||
|
||||
bool in_transition = owner_window()->fullscreen_transition_state() !=
|
||||
NativeWindow::FullScreenTransitionState::NONE;
|
||||
NativeWindow::FullScreenTransitionState::kNone;
|
||||
bool is_html_transition = owner_window()->fullscreen_transition_type() ==
|
||||
NativeWindow::FullScreenTransitionType::HTML;
|
||||
NativeWindow::FullScreenTransitionType::kHTML;
|
||||
|
||||
return is_html_fullscreen() || (in_transition && is_html_transition);
|
||||
}
|
||||
|
|
|
@ -757,7 +757,7 @@ std::string NativeWindow::GetAccessibleTitle() {
|
|||
|
||||
void NativeWindow::HandlePendingFullscreenTransitions() {
|
||||
if (pending_transitions_.empty()) {
|
||||
set_fullscreen_transition_type(FullScreenTransitionType::NONE);
|
||||
set_fullscreen_transition_type(FullScreenTransitionType::kNone);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -332,7 +332,7 @@ class NativeWindow : public base::SupportsUserData,
|
|||
// Handle fullscreen transitions.
|
||||
void HandlePendingFullscreenTransitions();
|
||||
|
||||
enum class FullScreenTransitionState { ENTERING, EXITING, NONE };
|
||||
enum class FullScreenTransitionState { kEntering, kExiting, kNone };
|
||||
|
||||
void set_fullscreen_transition_state(FullScreenTransitionState state) {
|
||||
fullscreen_transition_state_ = state;
|
||||
|
@ -341,7 +341,7 @@ class NativeWindow : public base::SupportsUserData,
|
|||
return fullscreen_transition_state_;
|
||||
}
|
||||
|
||||
enum class FullScreenTransitionType { HTML, NATIVE, NONE };
|
||||
enum class FullScreenTransitionType { kHTML, kNative, kNone };
|
||||
|
||||
void set_fullscreen_transition_type(FullScreenTransitionType type) {
|
||||
fullscreen_transition_type_ = type;
|
||||
|
@ -416,9 +416,9 @@ class NativeWindow : public base::SupportsUserData,
|
|||
|
||||
std::queue<bool> pending_transitions_;
|
||||
FullScreenTransitionState fullscreen_transition_state_ =
|
||||
FullScreenTransitionState::NONE;
|
||||
FullScreenTransitionState::kNone;
|
||||
FullScreenTransitionType fullscreen_transition_type_ =
|
||||
FullScreenTransitionType::NONE;
|
||||
FullScreenTransitionType::kNone;
|
||||
|
||||
private:
|
||||
std::unique_ptr<views::Widget> widget_;
|
||||
|
|
|
@ -384,7 +384,7 @@ void NativeWindowMac::Close() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (fullscreen_transition_state() != FullScreenTransitionState::NONE) {
|
||||
if (fullscreen_transition_state() != FullScreenTransitionState::kNone) {
|
||||
SetHasDeferredWindowClose(true);
|
||||
return;
|
||||
}
|
||||
|
@ -607,7 +607,7 @@ void NativeWindowMac::SetFullScreen(bool fullscreen) {
|
|||
// that it's possible to call it while a fullscreen transition is currently
|
||||
// in process. This can create weird behavior (incl. phantom windows),
|
||||
// so we want to schedule a transition for when the current one has completed.
|
||||
if (fullscreen_transition_state() != FullScreenTransitionState::NONE) {
|
||||
if (fullscreen_transition_state() != FullScreenTransitionState::kNone) {
|
||||
if (!pending_transitions_.empty()) {
|
||||
bool last_pending = pending_transitions_.back();
|
||||
// Only push new transitions if they're different than the last transition
|
||||
|
@ -632,8 +632,8 @@ void NativeWindowMac::SetFullScreen(bool fullscreen) {
|
|||
// or windowWillExitFullScreen are invoked, and so a potential transition
|
||||
// could be dropped.
|
||||
fullscreen_transition_state_ = fullscreen
|
||||
? FullScreenTransitionState::ENTERING
|
||||
: FullScreenTransitionState::EXITING;
|
||||
? FullScreenTransitionState::kEntering
|
||||
: FullScreenTransitionState::kExiting;
|
||||
|
||||
[window_ toggleFullScreenMode:nil];
|
||||
}
|
||||
|
@ -742,7 +742,7 @@ void NativeWindowMac::SetResizable(bool resizable) {
|
|||
|
||||
bool NativeWindowMac::IsResizable() {
|
||||
bool in_fs_transition =
|
||||
fullscreen_transition_state() != FullScreenTransitionState::NONE;
|
||||
fullscreen_transition_state() != FullScreenTransitionState::kNone;
|
||||
bool has_rs_mask = HasStyleMask(NSWindowStyleMaskResizable);
|
||||
return has_rs_mask && !IsFullscreen() && !in_fs_transition;
|
||||
}
|
||||
|
|
|
@ -273,7 +273,7 @@ using FullScreenTransitionState =
|
|||
// Store resizable mask so it can be restored after exiting fullscreen.
|
||||
is_resizable_ = shell_->HasStyleMask(NSWindowStyleMaskResizable);
|
||||
|
||||
shell_->set_fullscreen_transition_state(FullScreenTransitionState::ENTERING);
|
||||
shell_->set_fullscreen_transition_state(FullScreenTransitionState::kEntering);
|
||||
|
||||
shell_->NotifyWindowWillEnterFullScreen();
|
||||
|
||||
|
@ -282,7 +282,7 @@ using FullScreenTransitionState =
|
|||
}
|
||||
|
||||
- (void)windowDidEnterFullScreen:(NSNotification*)notification {
|
||||
shell_->set_fullscreen_transition_state(FullScreenTransitionState::NONE);
|
||||
shell_->set_fullscreen_transition_state(FullScreenTransitionState::kNone);
|
||||
|
||||
shell_->NotifyWindowEnterFullScreen();
|
||||
|
||||
|
@ -293,13 +293,13 @@ using FullScreenTransitionState =
|
|||
}
|
||||
|
||||
- (void)windowWillExitFullScreen:(NSNotification*)notification {
|
||||
shell_->set_fullscreen_transition_state(FullScreenTransitionState::EXITING);
|
||||
shell_->set_fullscreen_transition_state(FullScreenTransitionState::kExiting);
|
||||
|
||||
shell_->NotifyWindowWillLeaveFullScreen();
|
||||
}
|
||||
|
||||
- (void)windowDidExitFullScreen:(NSNotification*)notification {
|
||||
shell_->set_fullscreen_transition_state(FullScreenTransitionState::NONE);
|
||||
shell_->set_fullscreen_transition_state(FullScreenTransitionState::kNone);
|
||||
|
||||
shell_->SetResizable(is_resizable_);
|
||||
shell_->NotifyWindowLeaveFullScreen();
|
||||
|
|
Loading…
Reference in a new issue