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

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

Issue 196723009: Not submitted - Fixing invalid visibility states with layers which showed up in unittests ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 const Window* root_window = GetRootWindow(); 353 const Window* root_window = GetRootWindow();
354 return root_window ? root_window->host_ : NULL; 354 return root_window ? root_window->host_ : NULL;
355 } 355 }
356 356
357 void Window::Show() { 357 void Window::Show() {
358 if (layer()) { 358 if (layer()) {
359 DCHECK_EQ(visible_, layer()->GetTargetVisibility()); 359 DCHECK_EQ(visible_, layer()->GetTargetVisibility());
360 // It is not allowed that a window is visible but the layers alpha is fully 360 // It is not allowed that a window is visible but the layers alpha is fully
361 // transparent since the window would still be considered to be active but 361 // transparent since the window would still be considered to be active but
362 // could not be seen. 362 // could not be seen.
363 // TODO(skuhne): uncomment and fix issue 351553. 363 DCHECK(!(visible_ && layer()->GetTargetOpacity() == 0.0f));
364 // DCHECK(!(visible_ && layer()->GetTargetOpacity() == 0.0f));
365 } 364 }
366 SetVisible(true); 365 SetVisible(true);
367 } 366 }
368 367
369 void Window::Hide() { 368 void Window::Hide() {
370 // RootWindow::OnVisibilityChanged will call ReleaseCapture. 369 // RootWindow::OnVisibilityChanged will call ReleaseCapture.
371 SetVisible(false); 370 SetVisible(false);
372 } 371 }
373 372
374 bool Window::IsVisible() const { 373 bool Window::IsVisible() const {
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1445 return window; 1444 return window;
1446 if (offset) 1445 if (offset)
1447 *offset += window->bounds().OffsetFromOrigin(); 1446 *offset += window->bounds().OffsetFromOrigin();
1448 } 1447 }
1449 if (offset) 1448 if (offset)
1450 *offset = gfx::Vector2d(); 1449 *offset = gfx::Vector2d();
1451 return NULL; 1450 return NULL;
1452 } 1451 }
1453 1452
1454 } // namespace aura 1453 } // namespace aura
OLDNEW
« ash/wm/overview/window_overview.cc ('K') | « ash/wm/system_modal_container_layout_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698