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

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

Issue 8202026: views: Some more layer change, and add/update some tests for layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/logging.h" 9 #include "base/logging.h"
10 #include "ui/aura/desktop.h" 10 #include "ui/aura/desktop.h"
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 } 360 }
361 361
362 internal::RootWindow* Window::GetRoot() { 362 internal::RootWindow* Window::GetRoot() {
363 return parent_ ? parent_->GetRoot() : NULL; 363 return parent_ ? parent_->GetRoot() : NULL;
364 } 364 }
365 365
366 void Window::SetVisible(bool visible) { 366 void Window::SetVisible(bool visible) {
367 bool was_visible = IsVisible(); 367 bool was_visible = IsVisible();
368 layer_->SetVisible(visible); 368 layer_->SetVisible(visible);
369 bool is_visible = IsVisible(); 369 bool is_visible = IsVisible();
370 if (was_visible != is_visible) 370 if (was_visible != is_visible) {
371 SchedulePaint(); 371 SchedulePaint();
372 delegate_->OnWindowVisibilityChanged(is_visible);
373 }
372 } 374 }
373 375
374 void Window::SchedulePaint() { 376 void Window::SchedulePaint() {
375 SchedulePaintInRect(gfx::Rect(0, 0, bounds().width(), bounds().height())); 377 SchedulePaintInRect(gfx::Rect(0, 0, bounds().width(), bounds().height()));
376 } 378 }
377 379
378 bool Window::StopsEventPropagation() const { 380 bool Window::StopsEventPropagation() const {
379 return stops_event_propagation_ && !children_.empty(); 381 return stops_event_propagation_ && !children_.empty();
380 } 382 }
381 383
382 bool Window::UpdateShowStateAndRestoreBounds( 384 bool Window::UpdateShowStateAndRestoreBounds(
383 ui::WindowShowState new_show_state) { 385 ui::WindowShowState new_show_state) {
384 if (show_state_ == new_show_state) 386 if (show_state_ == new_show_state)
385 return false; 387 return false;
386 show_state_ = new_show_state; 388 show_state_ = new_show_state;
387 if (restore_bounds_.IsEmpty()) 389 if (restore_bounds_.IsEmpty())
388 restore_bounds_ = bounds(); 390 restore_bounds_ = bounds();
389 return true; 391 return true;
390 } 392 }
391 393
392 void Window::OnPaintLayer(gfx::Canvas* canvas) { 394 void Window::OnPaintLayer(gfx::Canvas* canvas) {
393 delegate_->OnPaint(canvas); 395 delegate_->OnPaint(canvas);
394 } 396 }
395 397
396 } // namespace aura 398 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698