feat: add BrowserWindow.isTabletMode API (#25209)

This commit is contained in:
Cheng Zhao 2020-09-22 14:40:42 +09:00 committed by GitHub
parent 2dd7ad268b
commit c50ded2b71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 32 additions and 0 deletions

View file

@ -60,6 +60,7 @@
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h"
#include "ui/views/window/native_frame_view.h"
#elif defined(OS_WIN)
#include "base/win/win_util.h"
#include "shell/browser/ui/views/win_frame_view.h"
#include "shell/browser/ui/win/electron_desktop_native_widget_aura.h"
#include "skia/ext/skia_utils_win.h"
@ -901,6 +902,14 @@ bool NativeWindowViews::IsKiosk() {
return IsFullscreen();
}
bool NativeWindowViews::IsTabletMode() const {
#if defined(OS_WIN)
return base::win::IsWindows10TabletMode(GetAcceleratedWidget());
#else
return false;
#endif
}
SkColor NativeWindowViews::GetBackgroundColor() {
return root_view_->background()->get_color();
}