Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Unified Diff: ui/views/win/scoped_fullscreen_visibility.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/win/scoped_fullscreen_visibility.h ('k') | ui/views/window/client_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/win/scoped_fullscreen_visibility.cc
diff --git a/ui/views/win/scoped_fullscreen_visibility.cc b/ui/views/win/scoped_fullscreen_visibility.cc
deleted file mode 100644
index b6fd33f1d7f8c6f6312e550754b391812ffbb211..0000000000000000000000000000000000000000
--- a/ui/views/win/scoped_fullscreen_visibility.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/views/win/scoped_fullscreen_visibility.h"
-
-#include "base/logging.h"
-
-namespace views {
-
-// static
-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));
- // NOTE: Be careful not to activate any windows here (for example, calling
- // ShowWindow(SW_HIDE) will automatically activate another window). This
- // code can be called while a window is being deactivated, and activating
- // another window will screw up the activation that is already in progress.
- 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;
- }
-}
-
-// static
-bool ScopedFullscreenVisibility::IsHiddenForFullscreen(HWND hwnd) {
- if (!full_screen_windows_)
- return false;
- return full_screen_windows_->find(hwnd) != full_screen_windows_->end();
-}
-
-} // namespace views
« no previous file with comments | « ui/views/win/scoped_fullscreen_visibility.h ('k') | ui/views/window/client_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698