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

Side by Side Diff: ui/aura/window.cc

Issue 1417903005: Revert of Remove DCHECK_IMPLIES/CHECK_IMPLIES. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « gpu/command_buffer/service/texture_definition.cc ('k') | ui/events/blink/blink_event_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/aura/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 const WindowTreeHost* Window::GetHost() const { 216 const WindowTreeHost* Window::GetHost() const {
217 const Window* root_window = GetRootWindow(); 217 const Window* root_window = GetRootWindow();
218 return root_window ? root_window->host_ : NULL; 218 return root_window ? root_window->host_ : NULL;
219 } 219 }
220 220
221 void Window::Show() { 221 void Window::Show() {
222 DCHECK_EQ(visible_, layer()->GetTargetVisibility()); 222 DCHECK_EQ(visible_, layer()->GetTargetVisibility());
223 // It is not allowed that a window is visible but the layers alpha is fully 223 // It is not allowed that a window is visible but the layers alpha is fully
224 // transparent since the window would still be considered to be active but 224 // transparent since the window would still be considered to be active but
225 // could not be seen. 225 // could not be seen.
226 DCHECK(!visible_ || layer()->GetTargetOpacity() > 0.0f); 226 DCHECK_IMPLIES(visible_, layer()->GetTargetOpacity() > 0.0f);
227 SetVisible(true); 227 SetVisible(true);
228 } 228 }
229 229
230 void Window::Hide() { 230 void Window::Hide() {
231 // RootWindow::OnVisibilityChanged will call ReleaseCapture. 231 // RootWindow::OnVisibilityChanged will call ReleaseCapture.
232 SetVisible(false); 232 SetVisible(false);
233 } 233 }
234 234
235 bool Window::IsVisible() const { 235 bool Window::IsVisible() const {
236 // Layer visibility can be inconsistent with window visibility, for example 236 // Layer visibility can be inconsistent with window visibility, for example
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 layer_name = "Unnamed Window"; 1108 layer_name = "Unnamed Window";
1109 1109
1110 if (id_ != -1) 1110 if (id_ != -1)
1111 layer_name += " " + base::IntToString(id_); 1111 layer_name += " " + base::IntToString(id_);
1112 1112
1113 layer()->set_name(layer_name); 1113 layer()->set_name(layer_name);
1114 #endif 1114 #endif
1115 } 1115 }
1116 1116
1117 } // namespace aura 1117 } // namespace aura
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/texture_definition.cc ('k') | ui/events/blink/blink_event_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698