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

Side by Side Diff: chrome/browser/ui/views/exclusive_access_bubble_views.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 "chrome/browser/ui/views/exclusive_access_bubble_views.h" 5 #include "chrome/browser/ui/views/exclusive_access_bubble_views.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 key_name_label_->SetBackgroundColor(background_color); 138 key_name_label_->SetBackgroundColor(background_color);
139 139
140 key_name_ = new views::View; 140 key_name_ = new views::View;
141 views::BoxLayout* key_name_layout = new views::BoxLayout( 141 views::BoxLayout* key_name_layout = new views::BoxLayout(
142 views::BoxLayout::kHorizontal, kKeyNamePaddingPx, 0, 0); 142 views::BoxLayout::kHorizontal, kKeyNamePaddingPx, 0, 0);
143 key_name_layout->set_minimum_cross_axis_size( 143 key_name_layout->set_minimum_cross_axis_size(
144 key_name_label_->GetPreferredSize().height() + kKeyNamePaddingPx * 2); 144 key_name_label_->GetPreferredSize().height() + kKeyNamePaddingPx * 2);
145 key_name_->SetLayoutManager(key_name_layout); 145 key_name_->SetLayoutManager(key_name_layout);
146 key_name_->AddChildView(key_name_label_); 146 key_name_->AddChildView(key_name_label_);
147 // The key name has a border around it. 147 // The key name has a border around it.
148 scoped_ptr<views::Border> border(views::Border::CreateRoundedRectBorder( 148 std::unique_ptr<views::Border> border(views::Border::CreateRoundedRectBorder(
149 kKeyNameBorderPx, kKeyNameCornerRadius, foreground_color)); 149 kKeyNameBorderPx, kKeyNameCornerRadius, foreground_color));
150 key_name_->SetBorder(std::move(border)); 150 key_name_->SetBorder(std::move(border));
151 AddChildView(key_name_); 151 AddChildView(key_name_);
152 152
153 after_key_ = new views::Label(base::string16(), font_list); 153 after_key_ = new views::Label(base::string16(), font_list);
154 after_key_->SetEnabledColor(foreground_color); 154 after_key_->SetEnabledColor(foreground_color);
155 after_key_->SetBackgroundColor(background_color); 155 after_key_->SetBackgroundColor(background_color);
156 AddChildView(after_key_); 156 AddChildView(after_key_);
157 157
158 SetText(text); 158 SetText(text);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 ui::NativeTheme* theme = ui::NativeTheme::GetInstanceForWeb(); 246 ui::NativeTheme* theme = ui::NativeTheme::GetInstanceForWeb();
247 SkColor background_color = 247 SkColor background_color =
248 ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled() 248 ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()
249 ? kBackgroundColor 249 ? kBackgroundColor
250 : theme->GetSystemColor(ui::NativeTheme::kColorId_BubbleBackground); 250 : theme->GetSystemColor(ui::NativeTheme::kColorId_BubbleBackground);
251 SkColor foreground_color = 251 SkColor foreground_color =
252 ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled() 252 ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()
253 ? SK_ColorWHITE 253 ? SK_ColorWHITE
254 : theme->GetSystemColor(ui::NativeTheme::kColorId_LabelEnabledColor); 254 : theme->GetSystemColor(ui::NativeTheme::kColorId_LabelEnabledColor);
255 255
256 scoped_ptr<views::BubbleBorder> bubble_border(new views::BubbleBorder( 256 std::unique_ptr<views::BubbleBorder> bubble_border(new views::BubbleBorder(
257 views::BubbleBorder::NONE, shadow_type, background_color)); 257 views::BubbleBorder::NONE, shadow_type, background_color));
258 set_background(new views::BubbleBackground(bubble_border.get())); 258 set_background(new views::BubbleBackground(bubble_border.get()));
259 SetBorder(std::move(bubble_border)); 259 SetBorder(std::move(bubble_border));
260 SetFocusable(false); 260 SetFocusable(false);
261 261
262 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 262 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
263 const gfx::FontList& font_list = 263 const gfx::FontList& font_list =
264 rb.GetFontList(ui::ResourceBundle::MediumFont); 264 rb.GetFontList(ui::ResourceBundle::MediumFont);
265 265
266 if (!ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) { 266 if (!ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) {
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 const content::NotificationDetails& details) { 648 const content::NotificationDetails& details) {
649 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); 649 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type);
650 UpdateForImmersiveState(); 650 UpdateForImmersiveState();
651 } 651 }
652 652
653 void ExclusiveAccessBubbleViews::OnWidgetVisibilityChanged( 653 void ExclusiveAccessBubbleViews::OnWidgetVisibilityChanged(
654 views::Widget* widget, 654 views::Widget* widget,
655 bool visible) { 655 bool visible) {
656 UpdateMouseWatcher(); 656 UpdateMouseWatcher();
657 } 657 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698