Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Side by Side Diff: chrome/browser/ui/views/infobars/extension_infobar.cc

Issue 12578008: Move CrxFile, FileReader, ExtensionResource to src/extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/extensions/image_loader.h" 10 #include "chrome/browser/extensions/image_loader.h"
11 #include "chrome/browser/platform_util.h" 11 #include "chrome/browser/platform_util.h"
12 #include "chrome/browser/ui/views/frame/browser_view.h" 12 #include "chrome/browser/ui/views/frame/browser_view.h"
13 #include "chrome/common/extensions/api/icons/icons_handler.h" 13 #include "chrome/common/extensions/api/icons/icons_handler.h"
14 #include "chrome/common/extensions/extension.h" 14 #include "chrome/common/extensions/extension.h"
15 #include "chrome/common/extensions/extension_constants.h" 15 #include "chrome/common/extensions/extension_constants.h"
16 #include "chrome/common/extensions/extension_icon_set.h" 16 #include "chrome/common/extensions/extension_icon_set.h"
17 #include "chrome/common/extensions/extension_resource.h" 17 #include "extensions/common/extension_resource.h"
18 #include "grit/theme_resources.h" 18 #include "grit/theme_resources.h"
19 #include "ui/base/animation/slide_animation.h" 19 #include "ui/base/animation/slide_animation.h"
20 #include "ui/base/resource/resource_bundle.h" 20 #include "ui/base/resource/resource_bundle.h"
21 #include "ui/gfx/canvas.h" 21 #include "ui/gfx/canvas.h"
22 #include "ui/gfx/image/canvas_image_source.h" 22 #include "ui/gfx/image/canvas_image_source.h"
23 #include "ui/gfx/image/image.h" 23 #include "ui/gfx/image/image.h"
24 #include "ui/views/controls/button/menu_button.h" 24 #include "ui/views/controls/button/menu_button.h"
25 #include "ui/views/controls/image_view.h" 25 #include "ui/views/controls/image_view.h"
26 #include "ui/views/controls/menu/menu_item_view.h" 26 #include "ui/views/controls/menu/menu_item_view.h"
27 #include "ui/views/widget/widget.h" 27 #include "ui/views/widget/widget.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // This must happen after adding all other children so InfoBarView can ensure 139 // This must happen after adding all other children so InfoBarView can ensure
140 // the close button is the last child. 140 // the close button is the last child.
141 InfoBarView::ViewHierarchyChanged(is_add, parent, child); 141 InfoBarView::ViewHierarchyChanged(is_add, parent, child);
142 142
143 // This must happen after adding all children because it can trigger layout, 143 // This must happen after adding all children because it can trigger layout,
144 // which assumes that particular children (e.g. the close button) have already 144 // which assumes that particular children (e.g. the close button) have already
145 // been added. 145 // been added.
146 const extensions::Extension* extension = extension_host->extension(); 146 const extensions::Extension* extension = extension_host->extension();
147 extension_misc::ExtensionIcons image_size = 147 extension_misc::ExtensionIcons image_size =
148 extension_misc::EXTENSION_ICON_BITTY; 148 extension_misc::EXTENSION_ICON_BITTY;
149 ExtensionResource icon_resource = extensions::IconsInfo::GetIconResource( 149 extensions::ExtensionResource icon_resource =
150 extension, image_size, ExtensionIconSet::MATCH_EXACTLY); 150 extensions::IconsInfo::GetIconResource(
151 extension, image_size, ExtensionIconSet::MATCH_EXACTLY);
151 extensions::ImageLoader* loader = 152 extensions::ImageLoader* loader =
152 extensions::ImageLoader::Get(extension_host->profile()); 153 extensions::ImageLoader::Get(extension_host->profile());
153 loader->LoadImageAsync( 154 loader->LoadImageAsync(
154 extension, 155 extension,
155 icon_resource, 156 icon_resource,
156 gfx::Size(image_size, image_size), 157 gfx::Size(image_size, image_size),
157 base::Bind(&ExtensionInfoBar::OnImageLoaded, 158 base::Bind(&ExtensionInfoBar::OnImageLoaded,
158 weak_ptr_factory_.GetWeakPtr())); 159 weak_ptr_factory_.GetWeakPtr()));
159 } 160 }
160 161
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 208 }
208 209
209 infobar_icon_->SetVisible(true); 210 infobar_icon_->SetVisible(true);
210 211
211 Layout(); 212 Layout();
212 } 213 }
213 214
214 ExtensionInfoBarDelegate* ExtensionInfoBar::GetDelegate() { 215 ExtensionInfoBarDelegate* ExtensionInfoBar::GetDelegate() {
215 return delegate_ ? delegate_->AsExtensionInfoBarDelegate() : NULL; 216 return delegate_ ? delegate_->AsExtensionInfoBarDelegate() : NULL;
216 } 217 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/location_bar/page_action_image_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698