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

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

Issue 941133002: Update global error bubble view's boundary (position and size) after loading elevation icon. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/elevation_icon_setter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/callback_forward.h"
8 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
10 11
11 class SkBitmap; 12 class SkBitmap;
12 13
13 namespace views { 14 namespace views {
14 class LabelButton; 15 class LabelButton;
15 } 16 }
16 17
17 // On Windows, badges a button with a "UAC shield" icon to indicate that 18 // On Windows, badges a button with a "UAC shield" icon to indicate that
18 // clicking will trigger a UAC elevation prompt. Does nothing on other 19 // clicking will trigger a UAC elevation prompt. Does nothing on other
19 // platforms. 20 // platforms.
20 class ElevationIconSetter { 21 class ElevationIconSetter {
21 public: 22 public:
22 // |button| must be guaranteed to be alive throughout this class' lifetime! 23 // |button| must be guaranteed to be alive throughout this class' lifetime!
23 explicit ElevationIconSetter(views::LabelButton* button); 24 // |callback| will be called if the button icon is actually changed; callers
25 // should pass a function which does a relayout on the view containing the
26 // button, to ensure the button is correctly resized as necessary.
27 ElevationIconSetter(views::LabelButton* button,
28 const base::Closure& callback);
24 ~ElevationIconSetter(); 29 ~ElevationIconSetter();
25 30
26 private: 31 private:
27 void SetButtonIcon(scoped_ptr<SkBitmap> icon); 32 void SetButtonIcon(const base::Closure& callback, scoped_ptr<SkBitmap> icon);
28 33
29 views::LabelButton* button_; 34 views::LabelButton* button_;
30 base::WeakPtrFactory<ElevationIconSetter> weak_factory_; 35 base::WeakPtrFactory<ElevationIconSetter> weak_factory_;
31 36
32 DISALLOW_COPY_AND_ASSIGN(ElevationIconSetter); 37 DISALLOW_COPY_AND_ASSIGN(ElevationIconSetter);
33 }; 38 };
34 39
35 #endif // CHROME_BROWSER_UI_VIEWS_ELEVATION_ICON_SETTER_H_ 40 #endif // CHROME_BROWSER_UI_VIEWS_ELEVATION_ICON_SETTER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/elevation_icon_setter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698