OLD | NEW |
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/extension_installed_bubble_controlle
r.h" | 5 #import "chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controlle
r.h" |
6 | 6 |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/mac/bundle_locations.h" | 8 #include "base/mac/bundle_locations.h" |
9 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 : controller_(controller) { | 60 : controller_(controller) { |
61 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 61 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
62 content::Source<Profile>(profile)); | 62 content::Source<Profile>(profile)); |
63 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 63 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, |
64 content::Source<Profile>(profile)); | 64 content::Source<Profile>(profile)); |
65 } | 65 } |
66 | 66 |
67 private: | 67 private: |
68 // NotificationObserver implementation. Tells the controller to start showing | 68 // NotificationObserver implementation. Tells the controller to start showing |
69 // its window on the main thread when the extension has finished loading. | 69 // its window on the main thread when the extension has finished loading. |
70 void Observe(int type, | 70 virtual void Observe( |
71 const content::NotificationSource& source, | 71 int type, |
72 const content::NotificationDetails& details) { | 72 const content::NotificationSource& source, |
| 73 const content::NotificationDetails& details) OVERRIDE { |
73 if (type == chrome::NOTIFICATION_EXTENSION_LOADED) { | 74 if (type == chrome::NOTIFICATION_EXTENSION_LOADED) { |
74 const Extension* extension = | 75 const Extension* extension = |
75 content::Details<const Extension>(details).ptr(); | 76 content::Details<const Extension>(details).ptr(); |
76 if (extension == [controller_ extension]) { | 77 if (extension == [controller_ extension]) { |
77 [controller_ performSelectorOnMainThread:@selector(showWindow:) | 78 [controller_ performSelectorOnMainThread:@selector(showWindow:) |
78 withObject:controller_ | 79 withObject:controller_ |
79 waitUntilDone:NO]; | 80 waitUntilDone:NO]; |
80 } | 81 } |
81 } else if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) { | 82 } else if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) { |
82 const Extension* extension = | 83 const Extension* extension = |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 ExtensionInstallUI::OpenAppInstalledUI(browser_, extension_->id()); | 698 ExtensionInstallUI::OpenAppInstalledUI(browser_, extension_->id()); |
698 } | 699 } |
699 | 700 |
700 - (void)awakeFromNib { | 701 - (void)awakeFromNib { |
701 if (bundle_) | 702 if (bundle_) |
702 return; | 703 return; |
703 [self initializeLabel]; | 704 [self initializeLabel]; |
704 } | 705 } |
705 | 706 |
706 @end | 707 @end |
OLD | NEW |