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

Side by Side Diff: chrome/browser/ui/views/download/download_started_animation_views.cc

Issue 2016203002: Widget opacity goes from 0 to 1, not 0 to 255. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resync Created 4 years, 6 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 | « cc/layers/layer.cc ('k') | chrome/browser/ui/views/new_back_shortcut_bubble.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 "chrome/browser/download/download_started_animation.h" 5 #include "chrome/browser/download/download_started_animation.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "content/public/browser/web_contents.h" 8 #include "content/public/browser/web_contents.h"
9 #include "grit/theme_resources.h" 9 #include "grit/theme_resources.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 SetImage(&download_image); 74 SetImage(&download_image);
75 75
76 popup_ = new views::Widget; 76 popup_ = new views::Widget;
77 77
78 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); 78 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
79 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 79 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
80 params.accept_events = false; 80 params.accept_events = false;
81 params.parent = web_contents->GetNativeView(); 81 params.parent = web_contents->GetNativeView();
82 popup_->Init(params); 82 popup_->Init(params);
83 popup_->SetOpacity(0x00); 83 popup_->SetOpacity(0.f);
84 popup_->SetContentsView(this); 84 popup_->SetContentsView(this);
85 Reposition(); 85 Reposition();
86 popup_->Show(); 86 popup_->Show();
87 87
88 Start(); 88 Start();
89 } 89 }
90 90
91 void DownloadStartedAnimationViews::Reposition() { 91 void DownloadStartedAnimationViews::Reposition() {
92 // Align the image with the bottom left of the web contents (so that it 92 // Align the image with the bottom left of the web contents (so that it
93 // points to the newly created download). 93 // points to the newly created download).
(...skipping 24 matching lines...) Expand all
118 } 118 }
119 } 119 }
120 120
121 } // namespace 121 } // namespace
122 122
123 // static 123 // static
124 void DownloadStartedAnimation::Show(content::WebContents* web_contents) { 124 void DownloadStartedAnimation::Show(content::WebContents* web_contents) {
125 // The animation will delete itself when it's finished. 125 // The animation will delete itself when it's finished.
126 new DownloadStartedAnimationViews(web_contents); 126 new DownloadStartedAnimationViews(web_contents);
127 } 127 }
OLDNEW
« no previous file with comments | « cc/layers/layer.cc ('k') | chrome/browser/ui/views/new_back_shortcut_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698