OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ui/views/subtle_notification_view.h" | 5 #include "chrome/browser/ui/views/subtle_notification_view.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 const gfx::FontList& font_list = | 150 const gfx::FontList& font_list = |
151 rb.GetFontList(ui::ResourceBundle::MediumFont); | 151 rb.GetFontList(ui::ResourceBundle::MediumFont); |
152 | 152 |
153 instruction_view_ = new InstructionView(base::string16(), font_list, | 153 instruction_view_ = new InstructionView(base::string16(), font_list, |
154 kForegroundColor, kBackgroundColor); | 154 kForegroundColor, kBackgroundColor); |
155 | 155 |
156 link_ = new views::Link(); | 156 link_ = new views::Link(); |
157 link_->SetFocusBehavior(FocusBehavior::NEVER); | 157 link_->SetFocusBehavior(FocusBehavior::NEVER); |
158 link_->set_listener(link_listener); | 158 link_->set_listener(link_listener); |
159 link_->SetFontList(font_list); | 159 link_->SetFontList(font_list); |
160 link_->SetPressedColor(kForegroundColor); | |
161 link_->SetEnabledColor(kForegroundColor); | 160 link_->SetEnabledColor(kForegroundColor); |
162 link_->SetBackgroundColor(kBackgroundColor); | 161 link_->SetBackgroundColor(kBackgroundColor); |
163 link_->SetVisible(false); | 162 link_->SetVisible(false); |
164 | 163 |
165 int outer_padding_horiz = kOuterPaddingHorizPx; | 164 int outer_padding_horiz = kOuterPaddingHorizPx; |
166 int outer_padding_vert = kOuterPaddingVertPx; | 165 int outer_padding_vert = kOuterPaddingVertPx; |
167 AddChildView(instruction_view_); | 166 AddChildView(instruction_view_); |
168 AddChildView(link_); | 167 AddChildView(link_); |
169 | 168 |
170 views::BoxLayout* layout = | 169 views::BoxLayout* layout = |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // We set layout manager to nullptr to prevent the widget from sizing its | 201 // We set layout manager to nullptr to prevent the widget from sizing its |
203 // contents to the same size as itself. This prevents the widget contents from | 202 // contents to the same size as itself. This prevents the widget contents from |
204 // shrinking while we animate the height of the popup to give the impression | 203 // shrinking while we animate the height of the popup to give the impression |
205 // that it is sliding off the top of the screen. | 204 // that it is sliding off the top of the screen. |
206 // TODO(mgiuca): This probably isn't necessary now that there is no slide | 205 // TODO(mgiuca): This probably isn't necessary now that there is no slide |
207 // animation. Remove it. | 206 // animation. Remove it. |
208 popup->GetRootView()->SetLayoutManager(nullptr); | 207 popup->GetRootView()->SetLayoutManager(nullptr); |
209 | 208 |
210 return popup; | 209 return popup; |
211 } | 210 } |
OLD | NEW |