OLD | NEW |
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 #import "chrome/browser/ui/cocoa/extensions/extension_action_platform_delegate_c
ocoa.h" | 5 #import "chrome/browser/ui/cocoa/extensions/extension_action_platform_delegate_c
ocoa.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 ExtensionPopupController* popup = GetPopup(); | 56 ExtensionPopupController* popup = GetPopup(); |
57 return popup != nil ? [popup view] : nil; | 57 return popup != nil ? [popup view] : nil; |
58 } | 58 } |
59 | 59 |
60 bool ExtensionActionPlatformDelegateCocoa::IsMenuRunning() const { | 60 bool ExtensionActionPlatformDelegateCocoa::IsMenuRunning() const { |
61 // TODO(devlin): Also account for context menus. | 61 // TODO(devlin): Also account for context menus. |
62 return GetPopup() != nil; | 62 return GetPopup() != nil; |
63 } | 63 } |
64 | 64 |
65 void ExtensionActionPlatformDelegateCocoa::RegisterCommand() { | 65 void ExtensionActionPlatformDelegateCocoa::RegisterCommand() { |
66 // Commands are handled elsewhere for cocoa. | 66 // Commands are handled elsewhere for Cocoa. |
67 } | 67 } |
68 | 68 |
69 void ExtensionActionPlatformDelegateCocoa::OnDelegateSet() { | 69 void ExtensionActionPlatformDelegateCocoa::OnDelegateSet() { |
70 registrar_.Add( | 70 registrar_.Add( |
71 this, | 71 this, |
72 extensions::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, | 72 extensions::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, |
73 content::Source<Profile>(controller_->browser()->profile())); | 73 content::Source<Profile>(controller_->browser()->profile())); |
74 registrar_.Add( | 74 registrar_.Add( |
75 this, | 75 this, |
76 GetNotificationTypeForAction(*controller_->extension_action()), | 76 GetNotificationTypeForAction(*controller_->extension_action()), |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 controller_->IsEnabled( | 155 controller_->IsEnabled( |
156 controller_->view_delegate()->GetCurrentWebContents())) { | 156 controller_->view_delegate()->GetCurrentWebContents())) { |
157 controller_->ExecuteAction(true); | 157 controller_->ExecuteAction(true); |
158 } | 158 } |
159 break; | 159 break; |
160 } | 160 } |
161 default: | 161 default: |
162 NOTREACHED() << L"Unexpected notification"; | 162 NOTREACHED() << L"Unexpected notification"; |
163 } | 163 } |
164 } | 164 } |
OLD | NEW |