OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "browser_actions_controller.h" | 5 #import "browser_actions_controller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 - (int)currentTabId; | 176 - (int)currentTabId; |
177 @end | 177 @end |
178 | 178 |
179 // A helper class to proxy extension notifications to the view controller's | 179 // A helper class to proxy extension notifications to the view controller's |
180 // appropriate methods. | 180 // appropriate methods. |
181 class ExtensionServiceObserverBridge : public NotificationObserver, | 181 class ExtensionServiceObserverBridge : public NotificationObserver, |
182 public ExtensionToolbarModel::Observer { | 182 public ExtensionToolbarModel::Observer { |
183 public: | 183 public: |
184 ExtensionServiceObserverBridge(BrowserActionsController* owner, | 184 ExtensionServiceObserverBridge(BrowserActionsController* owner, |
185 Profile* profile) : owner_(owner) { | 185 Profile* profile) : owner_(owner) { |
186 registrar_.Add(this, NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE, | 186 registrar_.Add(this, chrome::EXTENSION_HOST_VIEW_SHOULD_CLOSE, |
187 Source<Profile>(profile)); | 187 Source<Profile>(profile)); |
188 } | 188 } |
189 | 189 |
190 // Overridden from NotificationObserver. | 190 // Overridden from NotificationObserver. |
191 void Observe(NotificationType type, | 191 void Observe(int type, |
192 const NotificationSource& source, | 192 const NotificationSource& source, |
193 const NotificationDetails& details) { | 193 const NotificationDetails& details) { |
194 switch (type.value) { | 194 switch (type) { |
195 case NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE: { | 195 case chrome::EXTENSION_HOST_VIEW_SHOULD_CLOSE: { |
196 ExtensionPopupController* popup = [ExtensionPopupController popup]; | 196 ExtensionPopupController* popup = [ExtensionPopupController popup]; |
197 if (popup && ![popup isClosing]) | 197 if (popup && ![popup isClosing]) |
198 [popup close]; | 198 [popup close]; |
199 | 199 |
200 break; | 200 break; |
201 } | 201 } |
202 default: | 202 default: |
203 NOTREACHED() << L"Unexpected notification"; | 203 NOTREACHED() << L"Unexpected notification"; |
204 } | 204 } |
205 } | 205 } |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 if (profile_->IsOffTheRecord()) | 859 if (profile_->IsOffTheRecord()) |
860 index = toolbarModel_->IncognitoIndexToOriginal(index); | 860 index = toolbarModel_->IncognitoIndexToOriginal(index); |
861 if (index < toolbarModel_->size()) { | 861 if (index < toolbarModel_->size()) { |
862 const Extension* extension = toolbarModel_->GetExtensionByIndex(index); | 862 const Extension* extension = toolbarModel_->GetExtensionByIndex(index); |
863 return [buttons_ objectForKey:base::SysUTF8ToNSString(extension->id())]; | 863 return [buttons_ objectForKey:base::SysUTF8ToNSString(extension->id())]; |
864 } | 864 } |
865 return nil; | 865 return nil; |
866 } | 866 } |
867 | 867 |
868 @end | 868 @end |
OLD | NEW |