This source file includes following definitions.
- IsHiddenForFullscreen
#include "ui/views/win/scoped_fullscreen_visibility.h"
#include "base/logging.h"
namespace views {
std::map<HWND, int>* ScopedFullscreenVisibility::full_screen_windows_ = NULL;
ScopedFullscreenVisibility::ScopedFullscreenVisibility(HWND hwnd)
: hwnd_(hwnd) {
if (!full_screen_windows_)
full_screen_windows_ = new FullscreenHWNDs;
FullscreenHWNDs::iterator it = full_screen_windows_->find(hwnd_);
if (it != full_screen_windows_->end()) {
it->second++;
} else {
full_screen_windows_->insert(std::make_pair(hwnd_, 1));
SetWindowPos(hwnd_, NULL, 0, 0, 0, 0,
SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE |
SWP_NOREPOSITION | SWP_NOSIZE | SWP_NOZORDER);
}
}
ScopedFullscreenVisibility::~ScopedFullscreenVisibility() {
FullscreenHWNDs::iterator it = full_screen_windows_->find(hwnd_);
DCHECK(it != full_screen_windows_->end());
if (--it->second == 0) {
full_screen_windows_->erase(it);
ShowWindow(hwnd_, SW_SHOW);
}
if (full_screen_windows_->empty()) {
delete full_screen_windows_;
full_screen_windows_ = NULL;
}
}
bool ScopedFullscreenVisibility::IsHiddenForFullscreen(HWND hwnd) {
if (!full_screen_windows_)
return false;
return full_screen_windows_->find(hwnd) != full_screen_windows_->end();
}
}