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 #include "chrome/browser/ui/views/infobars/extension_infobar.h" | 5 #include "chrome/browser/ui/views/infobars/extension_infobar.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_context_menu_model.h" | 7 #include "chrome/browser/extensions/extension_context_menu_model.h" |
8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
9 #include "chrome/browser/extensions/extension_infobar_delegate.h" | 9 #include "chrome/browser/extensions/extension_infobar_delegate.h" |
10 #include "chrome/browser/platform_util.h" | 10 #include "chrome/browser/platform_util.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 void ExtensionInfoBar::OnMenuButtonClicked(views::View* source, | 141 void ExtensionInfoBar::OnMenuButtonClicked(views::View* source, |
142 const gfx::Point& point) { | 142 const gfx::Point& point) { |
143 if (!owned()) | 143 if (!owned()) |
144 return; // We're closing; don't call anything, it might access the owner. | 144 return; // We're closing; don't call anything, it might access the owner. |
145 const Extension* extension = GetDelegate()->extension_host()->extension(); | 145 const Extension* extension = GetDelegate()->extension_host()->extension(); |
146 if (!extension->ShowConfigureContextMenus()) | 146 if (!extension->ShowConfigureContextMenus()) |
147 return; | 147 return; |
148 | 148 |
149 scoped_refptr<ExtensionContextMenuModel> options_menu_contents = | 149 scoped_refptr<ExtensionContextMenuModel> options_menu_contents = |
150 new ExtensionContextMenuModel(extension, browser_, NULL); | 150 new ExtensionContextMenuModel(extension, browser_); |
151 DCHECK_EQ(menu_, source); | 151 DCHECK_EQ(menu_, source); |
152 RunMenuAt(options_menu_contents.get(), menu_, views::MenuItemView::TOPLEFT); | 152 RunMenuAt(options_menu_contents.get(), menu_, views::MenuItemView::TOPLEFT); |
153 } | 153 } |
154 | 154 |
155 ExtensionInfoBarDelegate* ExtensionInfoBar::GetDelegate() { | 155 ExtensionInfoBarDelegate* ExtensionInfoBar::GetDelegate() { |
156 return delegate_ ? delegate_->AsExtensionInfoBarDelegate() : NULL; | 156 return delegate_ ? delegate_->AsExtensionInfoBarDelegate() : NULL; |
157 } | 157 } |
OLD | NEW |