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

Side by Side Diff: chrome/browser/ui/views/elevation_icon_setter.h

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 #ifndef CHROME_BROWSER_UI_VIEWS_ELEVATION_ICON_SETTER_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_ELEVATION_ICON_SETTER_H_
6 #define CHROME_BROWSER_UI_VIEWS_ELEVATION_ICON_SETTER_H_ 6 #define CHROME_BROWSER_UI_VIEWS_ELEVATION_ICON_SETTER_H_
7 7
8 #include <memory>
9
8 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
9 #include "base/macros.h" 11 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
12 13
13 class SkBitmap; 14 class SkBitmap;
14 15
15 namespace views { 16 namespace views {
16 class LabelButton; 17 class LabelButton;
17 } 18 }
18 19
19 // On Windows, badges a button with a "UAC shield" icon to indicate that 20 // On Windows, badges a button with a "UAC shield" icon to indicate that
20 // clicking will trigger a UAC elevation prompt. Does nothing on other 21 // clicking will trigger a UAC elevation prompt. Does nothing on other
21 // platforms. 22 // platforms.
22 class ElevationIconSetter { 23 class ElevationIconSetter {
23 public: 24 public:
24 // |button| must be guaranteed to be alive throughout this class' lifetime! 25 // |button| must be guaranteed to be alive throughout this class' lifetime!
25 // |callback| will be called if the button icon is actually changed; callers 26 // |callback| will be called if the button icon is actually changed; callers
26 // should pass a function which does a relayout on the view containing the 27 // should pass a function which does a relayout on the view containing the
27 // button, to ensure the button is correctly resized as necessary. 28 // button, to ensure the button is correctly resized as necessary.
28 ElevationIconSetter(views::LabelButton* button, 29 ElevationIconSetter(views::LabelButton* button,
29 const base::Closure& callback); 30 const base::Closure& callback);
30 ~ElevationIconSetter(); 31 ~ElevationIconSetter();
31 32
32 private: 33 private:
33 void SetButtonIcon(const base::Closure& callback, scoped_ptr<SkBitmap> icon); 34 void SetButtonIcon(const base::Closure& callback,
35 std::unique_ptr<SkBitmap> icon);
34 36
35 views::LabelButton* button_; 37 views::LabelButton* button_;
36 base::WeakPtrFactory<ElevationIconSetter> weak_factory_; 38 base::WeakPtrFactory<ElevationIconSetter> weak_factory_;
37 39
38 DISALLOW_COPY_AND_ASSIGN(ElevationIconSetter); 40 DISALLOW_COPY_AND_ASSIGN(ElevationIconSetter);
39 }; 41 };
40 42
41 #endif // CHROME_BROWSER_UI_VIEWS_ELEVATION_ICON_SETTER_H_ 43 #endif // CHROME_BROWSER_UI_VIEWS_ELEVATION_ICON_SETTER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/edit_search_engine_dialog.h ('k') | chrome/browser/ui/views/elevation_icon_setter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698