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

Side by Side Diff: ash/common/wm/window_cycle_list.cc

Issue 2480813003: Reduce views::Border creation verbosity by promoting factory functions (Closed)
Patch Set: fix bad merge Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/wm/window_cycle_list.h" 5 #include "ash/common/wm/window_cycle_list.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 9
10 #include "ash/common/wm/mru_window_tracker.h" 10 #include "ash/common/wm/mru_window_tracker.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 window_title_->SetEnabledColor(SK_ColorWHITE); 112 window_title_->SetEnabledColor(SK_ColorWHITE);
113 window_title_->SetAutoColorReadabilityEnabled(false); 113 window_title_->SetAutoColorReadabilityEnabled(false);
114 // Background is not fully opaque, so subpixel rendering won't look good. 114 // Background is not fully opaque, so subpixel rendering won't look good.
115 window_title_->SetSubpixelRenderingEnabled(false); 115 window_title_->SetSubpixelRenderingEnabled(false);
116 // The base font is 12pt (for English) so this comes out to 14pt. 116 // The base font is 12pt (for English) so this comes out to 14pt.
117 const int kLabelSizeDelta = 2; 117 const int kLabelSizeDelta = 2;
118 window_title_->SetFontList( 118 window_title_->SetFontList(
119 window_title_->font_list().DeriveWithSizeDelta(kLabelSizeDelta)); 119 window_title_->font_list().DeriveWithSizeDelta(kLabelSizeDelta));
120 const int kAboveLabelPadding = 5; 120 const int kAboveLabelPadding = 5;
121 const int kBelowLabelPadding = 10; 121 const int kBelowLabelPadding = 10;
122 window_title_->SetBorder(views::Border::CreateEmptyBorder( 122 window_title_->SetBorder(
123 kAboveLabelPadding, 0, kBelowLabelPadding, 0)); 123 views::CreateEmptyBorder(kAboveLabelPadding, 0, kBelowLabelPadding, 0));
124 AddChildView(window_title_); 124 AddChildView(window_title_);
125 125
126 // Preview padding is black at 50% opacity. 126 // Preview padding is black at 50% opacity.
127 preview_background_->set_background( 127 preview_background_->set_background(
128 views::Background::CreateSolidBackground( 128 views::Background::CreateSolidBackground(
129 SkColorSetA(SK_ColorBLACK, 0xFF / 2))); 129 SkColorSetA(SK_ColorBLACK, 0xFF / 2)));
130 AddChildView(preview_background_); 130 AddChildView(preview_background_);
131 131
132 AddChildView(mirror_view_); 132 AddChildView(mirror_view_);
133 133
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 widget->Init(params); 623 widget->Init(params);
624 624
625 screen_observer_.Add(display::Screen::GetScreen()); 625 screen_observer_.Add(display::Screen::GetScreen());
626 widget->Show(); 626 widget->Show();
627 widget->SetCapture(cycle_view_); 627 widget->SetCapture(cycle_view_);
628 widget->set_auto_release_capture(false); 628 widget->set_auto_release_capture(false);
629 cycle_ui_widget_ = widget; 629 cycle_ui_widget_ = widget;
630 } 630 }
631 631
632 } // namespace ash 632 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/overview/window_selector_item.cc ('k') | chrome/browser/chromeos/attestation/platform_verification_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698