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

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

Issue 1213193003: Remove DCHECK_IMPLIES and CHECK_IMPLIES (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « gpu/command_buffer/service/texture_definition.cc ('k') | ui/base/resource/data_pack.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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 const WindowTreeHost* Window::GetHost() const { 321 const WindowTreeHost* Window::GetHost() const {
322 const Window* root_window = GetRootWindow(); 322 const Window* root_window = GetRootWindow();
323 return root_window ? root_window->host_ : NULL; 323 return root_window ? root_window->host_ : NULL;
324 } 324 }
325 325
326 void Window::Show() { 326 void Window::Show() {
327 DCHECK_EQ(visible_, layer()->GetTargetVisibility()); 327 DCHECK_EQ(visible_, layer()->GetTargetVisibility());
328 // It is not allowed that a window is visible but the layers alpha is fully 328 // It is not allowed that a window is visible but the layers alpha is fully
329 // transparent since the window would still be considered to be active but 329 // transparent since the window would still be considered to be active but
330 // could not be seen. 330 // could not be seen.
331 DCHECK_IMPLIES(visible_, layer()->GetTargetOpacity() > 0.0f); 331 DCHECK(!visible_ || layer()->GetTargetOpacity() > 0.0f);
332 SetVisible(true); 332 SetVisible(true);
333 } 333 }
334 334
335 void Window::Hide() { 335 void Window::Hide() {
336 // RootWindow::OnVisibilityChanged will call ReleaseCapture. 336 // RootWindow::OnVisibilityChanged will call ReleaseCapture.
337 SetVisible(false); 337 SetVisible(false);
338 } 338 }
339 339
340 bool Window::IsVisible() const { 340 bool Window::IsVisible() const {
341 // Layer visibility can be inconsistent with window visibility, for example 341 // Layer visibility can be inconsistent with window visibility, for example
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 return window; 1401 return window;
1402 if (offset) 1402 if (offset)
1403 *offset += window->bounds().OffsetFromOrigin(); 1403 *offset += window->bounds().OffsetFromOrigin();
1404 } 1404 }
1405 if (offset) 1405 if (offset)
1406 *offset = gfx::Vector2d(); 1406 *offset = gfx::Vector2d();
1407 return NULL; 1407 return NULL;
1408 } 1408 }
1409 1409
1410 } // namespace aura 1410 } // namespace aura
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/texture_definition.cc ('k') | ui/base/resource/data_pack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698