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

Side by Side Diff: ash/common/shelf/overflow_button.cc

Issue 2190773003: [ABANDONED] Simplify ash shelf dimmer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore an EventHandler object; fix behavior tests. Created 4 years, 4 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 | « ash/common/shelf/app_list_button.cc ('k') | ash/common/shelf/wm_shelf.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/common/shelf/overflow_button.h" 5 #include "ash/common/shelf/overflow_button.h"
6 6
7 #include "ash/common/ash_constants.h" 7 #include "ash/common/ash_constants.h"
8 #include "ash/common/material_design/material_design_controller.h" 8 #include "ash/common/material_design/material_design_controller.h"
9 #include "ash/common/shelf/ink_drop_button_listener.h" 9 #include "ash/common/shelf/ink_drop_button_listener.h"
10 #include "ash/common/shelf/shelf_constants.h" 10 #include "ash/common/shelf/shelf_constants.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 121 }
122 122
123 canvas->DrawImageInt(*image, 123 canvas->DrawImageInt(*image,
124 bounds.x() + ((bounds.width() - image->width()) / 2), 124 bounds.x() + ((bounds.width() - image->width()) / 2),
125 bounds.y() + ((bounds.height() - image->height()) / 2)); 125 bounds.y() + ((bounds.height() - image->height()) / 2));
126 } 126 }
127 127
128 int OverflowButton::NonMaterialBackgroundImageId() { 128 int OverflowButton::NonMaterialBackgroundImageId() {
129 if (wm_shelf_->IsShowingOverflowBubble()) 129 if (wm_shelf_->IsShowingOverflowBubble())
130 return IDR_AURA_NOTIFICATION_BACKGROUND_PRESSED; 130 return IDR_AURA_NOTIFICATION_BACKGROUND_PRESSED;
131 else if (wm_shelf_->IsDimmed()) 131 else if (wm_shelf_->GetBackgroundType() == SHELF_BACKGROUND_MAXIMIZED)
132 return IDR_AURA_NOTIFICATION_BACKGROUND_ON_BLACK; 132 return IDR_AURA_NOTIFICATION_BACKGROUND_ON_BLACK;
133 return IDR_AURA_NOTIFICATION_BACKGROUND_NORMAL; 133 return IDR_AURA_NOTIFICATION_BACKGROUND_NORMAL;
134 } 134 }
135 135
136 gfx::Rect OverflowButton::CalculateButtonBounds() { 136 gfx::Rect OverflowButton::CalculateButtonBounds() {
137 ShelfAlignment alignment = wm_shelf_->GetAlignment(); 137 ShelfAlignment alignment = wm_shelf_->GetAlignment();
138 gfx::Rect bounds(GetContentsBounds()); 138 gfx::Rect bounds(GetContentsBounds());
139 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 139 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
140 if (MaterialDesignController::IsShelfMaterial()) { 140 if (MaterialDesignController::IsShelfMaterial()) {
141 const int width_offset = (bounds.width() - kOverflowButtonSize) / 2; 141 const int width_offset = (bounds.width() - kOverflowButtonSize) / 2;
(...skipping 22 matching lines...) Expand all
164 bounds = 164 bounds =
165 gfx::Rect(bounds.x() + (bounds.width() - background->width()) / 2, 165 gfx::Rect(bounds.x() + (bounds.width() - background->width()) / 2,
166 bounds.y() + kShelfItemInset, background->width(), 166 bounds.y() + kShelfItemInset, background->width(),
167 background->height()); 167 background->height());
168 } 168 }
169 } 169 }
170 return bounds; 170 return bounds;
171 } 171 }
172 172
173 } // namespace ash 173 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/app_list_button.cc ('k') | ash/common/shelf/wm_shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698