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_infobar_delegate.h" | 8 #include "chrome/browser/extensions/extension_infobar_delegate.h" |
9 #include "chrome/browser/extensions/extension_view_host.h" | 9 #include "chrome/browser/extensions/extension_view_host.h" |
10 #include "chrome/browser/extensions/image_loader.h" | 10 #include "chrome/browser/extensions/image_loader.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 if (!details.is_add || (details.child != this) || (infobar_icon_ != NULL)) { | 116 if (!details.is_add || (details.child != this) || (infobar_icon_ != NULL)) { |
117 InfoBarView::ViewHierarchyChanged(details); | 117 InfoBarView::ViewHierarchyChanged(details); |
118 return; | 118 return; |
119 } | 119 } |
120 | 120 |
121 extensions::ExtensionViewHost* extension_view_host = | 121 extensions::ExtensionViewHost* extension_view_host = |
122 GetDelegate()->extension_view_host(); | 122 GetDelegate()->extension_view_host(); |
123 | 123 |
124 if (extension_view_host->extension()->ShowConfigureContextMenus()) { | 124 if (extension_view_host->extension()->ShowConfigureContextMenus()) { |
125 icon_as_menu_ = new views::MenuButton(NULL, base::string16(), this, false); | 125 icon_as_menu_ = new views::MenuButton(NULL, base::string16(), this, false); |
126 icon_as_menu_->set_focusable(true); | 126 icon_as_menu_->SetFocusable(true); |
127 infobar_icon_ = icon_as_menu_; | 127 infobar_icon_ = icon_as_menu_; |
128 } else { | 128 } else { |
129 icon_as_image_ = new views::ImageView(); | 129 icon_as_image_ = new views::ImageView(); |
130 infobar_icon_ = icon_as_image_; | 130 infobar_icon_ = icon_as_image_; |
131 } | 131 } |
132 | 132 |
133 // Wait until the icon image is loaded before showing it. | 133 // Wait until the icon image is loaded before showing it. |
134 infobar_icon_->SetVisible(false); | 134 infobar_icon_->SetVisible(false); |
135 AddChildView(infobar_icon_); | 135 AddChildView(infobar_icon_); |
136 | 136 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 } | 204 } |
205 | 205 |
206 infobar_icon_->SetVisible(true); | 206 infobar_icon_->SetVisible(true); |
207 | 207 |
208 Layout(); | 208 Layout(); |
209 } | 209 } |
210 | 210 |
211 ExtensionInfoBarDelegate* ExtensionInfoBar::GetDelegate() { | 211 ExtensionInfoBarDelegate* ExtensionInfoBar::GetDelegate() { |
212 return delegate()->AsExtensionInfoBarDelegate(); | 212 return delegate()->AsExtensionInfoBarDelegate(); |
213 } | 213 } |
OLD | NEW |