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

Side by Side Diff: ash/common/system/tray/tray_background_view.cc

Issue 2231003002: Revert of Show small notification icons in notification tray (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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 "ash/common/system/tray/tray_background_view.h" 5 #include "ash/common/system/tray/tray_background_view.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/shelf/shelf_constants.h" 8 #include "ash/common/shelf/shelf_constants.h"
9 #include "ash/common/shelf/wm_shelf.h" 9 #include "ash/common/shelf/wm_shelf.h"
10 #include "ash/common/shelf/wm_shelf_util.h" 10 #include "ash/common/shelf/wm_shelf_util.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 UpdateLayout(); 168 UpdateLayout();
169 } 169 }
170 170
171 void TrayBackgroundView::TrayContainer::SetAlignment(ShelfAlignment alignment) { 171 void TrayBackgroundView::TrayContainer::SetAlignment(ShelfAlignment alignment) {
172 if (alignment_ == alignment) 172 if (alignment_ == alignment)
173 return; 173 return;
174 alignment_ = alignment; 174 alignment_ = alignment;
175 UpdateLayout(); 175 UpdateLayout();
176 } 176 }
177 177
178 void TrayBackgroundView::TrayContainer::SetMargin(const gfx::Insets& margin) {
179 margin_ = margin;
180 UpdateLayout();
181 }
182
183 gfx::Size TrayBackgroundView::TrayContainer::GetPreferredSize() const { 178 gfx::Size TrayBackgroundView::TrayContainer::GetPreferredSize() const {
184 if (size_.IsEmpty()) 179 if (size_.IsEmpty())
185 return views::View::GetPreferredSize(); 180 return views::View::GetPreferredSize();
186 return size_; 181 return size_;
187 } 182 }
188 183
189 void TrayBackgroundView::TrayContainer::ChildPreferredSizeChanged( 184 void TrayBackgroundView::TrayContainer::ChildPreferredSizeChanged(
190 views::View* child) { 185 views::View* child) {
191 PreferredSizeChanged(); 186 PreferredSizeChanged();
192 } 187 }
(...skipping 12 matching lines...) Expand all
205 // Adjust the size of status tray dark background by adding additional 200 // Adjust the size of status tray dark background by adding additional
206 // empty border. 201 // empty border.
207 views::BoxLayout::Orientation orientation = 202 views::BoxLayout::Orientation orientation =
208 IsHorizontalAlignment(alignment_) ? views::BoxLayout::kHorizontal 203 IsHorizontalAlignment(alignment_) ? views::BoxLayout::kHorizontal
209 : views::BoxLayout::kVertical; 204 : views::BoxLayout::kVertical;
210 205
211 if (!ash::MaterialDesignController::IsShelfMaterial()) { 206 if (!ash::MaterialDesignController::IsShelfMaterial()) {
212 // Additional padding used to adjust the user-visible size of status tray 207 // Additional padding used to adjust the user-visible size of status tray
213 // dark background. 208 // dark background.
214 const int padding = 3; 209 const int padding = 3;
215 SetBorder(views::Border::CreateEmptyBorder(gfx::Insets(padding) + margin_)); 210 SetBorder(
216 } else { 211 views::Border::CreateEmptyBorder(padding, padding, padding, padding));
217 SetBorder(views::Border::CreateEmptyBorder(margin_));
218 } 212 }
219 213
220 views::BoxLayout* layout = new views::BoxLayout(orientation, 0, 0, 0); 214 views::BoxLayout* layout = new views::BoxLayout(orientation, 0, 0, 0);
221 layout->SetDefaultFlex(1); 215 layout->SetDefaultFlex(1);
222 views::View::SetLayoutManager(layout); 216 views::View::SetLayoutManager(layout);
223 PreferredSizeChanged(); 217 PreferredSizeChanged();
224 } 218 }
225 219
226 //////////////////////////////////////////////////////////////////////////////// 220 ////////////////////////////////////////////////////////////////////////////////
227 // TrayBackgroundView 221 // TrayBackgroundView
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 } 499 }
506 500
507 void TrayBackgroundView::UpdateShelfItemBackground(int alpha) { 501 void TrayBackgroundView::UpdateShelfItemBackground(int alpha) {
508 if (background_) { 502 if (background_) {
509 background_->set_alpha(alpha); 503 background_->set_alpha(alpha);
510 SchedulePaint(); 504 SchedulePaint();
511 } 505 }
512 } 506 }
513 507
514 } // namespace ash 508 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray/tray_background_view.h ('k') | ash/common/system/web_notification/web_notification_tray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698