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

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

Issue 8383022: [Aura] Turns on Window opacity support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 return IsVisible() && show_state_ == ui::SHOW_STATE_FULLSCREEN; 402 return IsVisible() && show_state_ == ui::SHOW_STATE_FULLSCREEN;
403 403
404 for (Windows::const_iterator it = children_.begin(); 404 for (Windows::const_iterator it = children_.begin();
405 it != children_.end(); ++it) { 405 it != children_.end(); ++it) {
406 if ((*it)->IsOrContainsFullscreenWindow()) 406 if ((*it)->IsOrContainsFullscreenWindow())
407 return true; 407 return true;
408 } 408 }
409 return false; 409 return false;
410 } 410 }
411 411
412 void Window::SetOpacity(unsigned char opacity) {
413 layer_->SetOpacity(opacity / 255.0);
414 }
415
412 // static 416 // static
413 ui::Animation* Window::CreateDefaultAnimation() { 417 ui::Animation* Window::CreateDefaultAnimation() {
414 std::vector<ui::MultiAnimation::Part> parts; 418 std::vector<ui::MultiAnimation::Part> parts;
415 parts.push_back(ui::MultiAnimation::Part(200, ui::Tween::LINEAR)); 419 parts.push_back(ui::MultiAnimation::Part(200, ui::Tween::LINEAR));
416 ui::MultiAnimation* multi_animation = new ui::MultiAnimation(parts); 420 ui::MultiAnimation* multi_animation = new ui::MultiAnimation(parts);
417 multi_animation->set_continuous(false); 421 multi_animation->set_continuous(false);
418 return multi_animation; 422 return multi_animation;
419 } 423 }
420 424
421 Desktop* Window::GetDesktop() { 425 Desktop* Window::GetDesktop() {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 } 514 }
511 515
512 void Window::OnPaintLayer(gfx::Canvas* canvas) { 516 void Window::OnPaintLayer(gfx::Canvas* canvas) {
513 delegate_->OnPaint(canvas); 517 delegate_->OnPaint(canvas);
514 } 518 }
515 519
516 void Window::OnLayerAnimationEnded(const ui::Animation* animation) { 520 void Window::OnLayerAnimationEnded(const ui::Animation* animation) {
517 } 521 }
518 522
519 } // namespace aura 523 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698