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

Unified Diff: chrome/browser/ui/views/exclusive_access_bubble_views.cc

Issue 1413523003: Made fullscreen bubble text non-transparent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/exclusive_access_bubble_views.cc
diff --git a/chrome/browser/ui/views/exclusive_access_bubble_views.cc b/chrome/browser/ui/views/exclusive_access_bubble_views.cc
index f8d5fe5ab87b49753b97943c201b0493de1f8198..6a8e0c38b9fa8b5e15ba4cc1de90957e0068ceed 100644
--- a/chrome/browser/ui/views/exclusive_access_bubble_views.cc
+++ b/chrome/browser/ui/views/exclusive_access_bubble_views.cc
@@ -44,10 +44,9 @@ namespace {
// Space between the site info label and the buttons / link.
const int kMiddlePaddingPx = 30;
-// Gets the opacity of the bubble when not animating.
-int GetMaximumOpacity() {
- return ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled() ? 180 : 255;
-}
+// Opacity of the background (out of 255). Only used with
+// IsSimplifiedFullscreenUIEnabled.
+const unsigned char kBackgroundOpacity = 180;
class ButtonView : public views::View {
public:
@@ -145,12 +144,12 @@ ExclusiveAccessBubbleViews::ExclusiveAccessView::ExclusiveAccessView(
shadow_type = views::BubbleBorder::SMALL_SHADOW;
#endif
if (ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled())
- shadow_type = views::BubbleBorder::NO_SHADOW;
+ shadow_type = views::BubbleBorder::NO_ASSETS;
ui::NativeTheme* theme = ui::NativeTheme::instance();
SkColor background_color =
ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()
- ? SK_ColorBLACK
+ ? SkColorSetA(SK_ColorBLACK, kBackgroundOpacity)
: theme->GetSystemColor(ui::NativeTheme::kColorId_BubbleBackground);
SkColor foreground_color =
ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()
@@ -341,7 +340,6 @@ ExclusiveAccessBubbleViews::ExclusiveAccessBubbleViews(
popup_->SetContentsView(view_);
gfx::Size size = GetPopupRect(true).size();
popup_->SetBounds(GetPopupRect(false));
- popup_->SetOpacity(GetMaximumOpacity());
// We set layout manager to nullptr to prevent the widget from sizing its
// contents to the same size as itself. This prevents the widget contents from
// shrinking while we animate the height of the popup to give the impression
@@ -445,7 +443,7 @@ void ExclusiveAccessBubbleViews::UpdateForImmersiveState() {
// assumes |popup_| has the opacity when it is fully shown and the opacity
// animation assumes |popup_| has the bounds when |popup_| is fully shown.
if (animated_attribute_ == ANIMATED_ATTRIBUTE_BOUNDS)
- popup_->SetOpacity(GetMaximumOpacity());
+ popup_->SetOpacity(255);
else
UpdateBounds();
}
@@ -468,7 +466,7 @@ views::View* ExclusiveAccessBubbleViews::GetBrowserRootView() const {
void ExclusiveAccessBubbleViews::AnimationProgressed(
const gfx::Animation* animation) {
if (animated_attribute_ == ANIMATED_ATTRIBUTE_OPACITY) {
- int opacity = animation_->CurrentValueBetween(0, GetMaximumOpacity());
+ int opacity = animation_->CurrentValueBetween(0, 255);
if (opacity == 0) {
popup_->Hide();
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698