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

Side by Side Diff: chrome/browser/ui/views/tabs/alert_indicator_button.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 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 "chrome/browser/ui/views/tabs/alert_indicator_button.h" 5 #include "chrome/browser/ui/views/tabs/alert_indicator_button.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "chrome/browser/ui/views/tabs/tab.h" 8 #include "chrome/browser/ui/views/tabs/tab.h"
9 #include "chrome/browser/ui/views/tabs/tab_controller.h" 9 #include "chrome/browser/ui/views/tabs/tab_controller.h"
10 #include "chrome/browser/ui/views/tabs/tab_renderer_data.h" 10 #include "chrome/browser/ui/views/tabs/tab_renderer_data.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 DISALLOW_COPY_AND_ASSIGN(FadeAnimationDelegate); 62 DISALLOW_COPY_AND_ASSIGN(FadeAnimationDelegate);
63 }; 63 };
64 64
65 AlertIndicatorButton::AlertIndicatorButton(Tab* parent_tab) 65 AlertIndicatorButton::AlertIndicatorButton(Tab* parent_tab)
66 : views::ImageButton(NULL), 66 : views::ImageButton(NULL),
67 parent_tab_(parent_tab), 67 parent_tab_(parent_tab),
68 alert_state_(TabAlertState::NONE), 68 alert_state_(TabAlertState::NONE),
69 showing_alert_state_(TabAlertState::NONE) { 69 showing_alert_state_(TabAlertState::NONE) {
70 DCHECK(parent_tab_); 70 DCHECK(parent_tab_);
71 SetEventTargeter( 71 SetEventTargeter(
72 scoped_ptr<views::ViewTargeter>(new views::ViewTargeter(this))); 72 std::unique_ptr<views::ViewTargeter>(new views::ViewTargeter(this)));
73 } 73 }
74 74
75 AlertIndicatorButton::~AlertIndicatorButton() {} 75 AlertIndicatorButton::~AlertIndicatorButton() {}
76 76
77 void AlertIndicatorButton::TransitionToAlertState(TabAlertState next_state) { 77 void AlertIndicatorButton::TransitionToAlertState(TabAlertState next_state) {
78 if (next_state == alert_state_) 78 if (next_state == alert_state_)
79 return; 79 return;
80 80
81 TabAlertState previous_alert_showing_state = showing_alert_state_; 81 TabAlertState previous_alert_showing_state = showing_alert_state_;
82 82
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 SkColor color = parent_tab_->button_color(); 260 SkColor color = parent_tab_->button_color();
261 gfx::ImageSkia indicator_image = 261 gfx::ImageSkia indicator_image =
262 chrome::GetTabAlertIndicatorImage(state, color).AsImageSkia(); 262 chrome::GetTabAlertIndicatorImage(state, color).AsImageSkia();
263 SetImage(views::CustomButton::STATE_NORMAL, &indicator_image); 263 SetImage(views::CustomButton::STATE_NORMAL, &indicator_image);
264 SetImage(views::CustomButton::STATE_DISABLED, &indicator_image); 264 SetImage(views::CustomButton::STATE_DISABLED, &indicator_image);
265 gfx::ImageSkia affordance_image = 265 gfx::ImageSkia affordance_image =
266 chrome::GetTabAlertIndicatorAffordanceImage(state, color).AsImageSkia(); 266 chrome::GetTabAlertIndicatorAffordanceImage(state, color).AsImageSkia();
267 SetImage(views::CustomButton::STATE_HOVERED, &affordance_image); 267 SetImage(views::CustomButton::STATE_HOVERED, &affordance_image);
268 SetImage(views::CustomButton::STATE_PRESSED, &affordance_image); 268 SetImage(views::CustomButton::STATE_PRESSED, &affordance_image);
269 } 269 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/alert_indicator_button.h ('k') | chrome/browser/ui/views/tabs/alert_indicator_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698