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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/browser_action_button.mm

Issue 671653002: Standardize usage of virtual/override/final in chrome/browser/ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h" 5 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 : public ExtensionActionIconFactory::Observer { 42 : public ExtensionActionIconFactory::Observer {
43 public: 43 public:
44 ExtensionActionIconFactoryBridge(BrowserActionButton* owner, 44 ExtensionActionIconFactoryBridge(BrowserActionButton* owner,
45 Profile* profile, 45 Profile* profile,
46 const Extension* extension) 46 const Extension* extension)
47 : owner_(owner), 47 : owner_(owner),
48 browser_action_([[owner cell] extensionAction]), 48 browser_action_([[owner cell] extensionAction]),
49 icon_factory_(profile, extension, browser_action_, this) { 49 icon_factory_(profile, extension, browser_action_, this) {
50 } 50 }
51 51
52 virtual ~ExtensionActionIconFactoryBridge() {} 52 ~ExtensionActionIconFactoryBridge() override {}
53 53
54 // ExtensionActionIconFactory::Observer implementation. 54 // ExtensionActionIconFactory::Observer implementation.
55 virtual void OnIconUpdated() override { 55 void OnIconUpdated() override { [owner_ updateState]; }
56 [owner_ updateState];
57 }
58 56
59 gfx::Image GetIcon(int tabId) { 57 gfx::Image GetIcon(int tabId) {
60 return icon_factory_.GetIcon(tabId); 58 return icon_factory_.GetIcon(tabId);
61 } 59 }
62 60
63 private: 61 private:
64 // Weak. Owns us. 62 // Weak. Owns us.
65 BrowserActionButton* owner_; 63 BrowserActionButton* owner_;
66 64
67 // The browser action whose images we're loading. 65 // The browser action whose images we're loading.
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 operation:NSCompositeSourceOver 329 operation:NSCompositeSourceOver
332 fraction:enabled ? 1.0 : 0.4 330 fraction:enabled ? 1.0 : 0.4
333 respectFlipped:YES 331 respectFlipped:YES
334 hints:nil]; 332 hints:nil];
335 333
336 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset; 334 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset;
337 [self drawBadgeWithinFrame:cellFrame]; 335 [self drawBadgeWithinFrame:cellFrame];
338 } 336 }
339 337
340 @end 338 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698