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

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

Issue 240193003: Move Infobars core files to the Infobars component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nib name on mac Created 6 years, 8 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_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 12 matching lines...) Expand all
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"
28 28
29 29
30 // ExtensionInfoBarDelegate ---------------------------------------------------- 30 // ExtensionInfoBarDelegate ----------------------------------------------------
31 31
32 // static 32 // static
33 scoped_ptr<InfoBar> ExtensionInfoBarDelegate::CreateInfoBar( 33 scoped_ptr<infobars::InfoBar> ExtensionInfoBarDelegate::CreateInfoBar(
34 scoped_ptr<ExtensionInfoBarDelegate> delegate) { 34 scoped_ptr<ExtensionInfoBarDelegate> delegate) {
35 Browser* browser = delegate->browser_; 35 Browser* browser = delegate->browser_;
36 return scoped_ptr<InfoBar>(new ExtensionInfoBar(delegate.Pass(), browser)); 36 return scoped_ptr<infobars::InfoBar>(
37 new ExtensionInfoBar(delegate.Pass(), browser));
37 } 38 }
38 39
39 40
40 // ExtensionInfoBar ------------------------------------------------------------ 41 // ExtensionInfoBar ------------------------------------------------------------
41 42
42 namespace { 43 namespace {
43 // The horizontal margin between the infobar icon and the Extension (HTML) view. 44 // The horizontal margin between the infobar icon and the Extension (HTML) view.
44 const int kIconHorizontalMargin = 1; 45 const int kIconHorizontalMargin = 1;
45 46
46 class MenuImageSource: public gfx::CanvasImageSource { 47 class MenuImageSource: public gfx::CanvasImageSource {
(...skipping 30 matching lines...) Expand all
77 const gfx::ImageSkia drop_image_; 78 const gfx::ImageSkia drop_image_;
78 79
79 DISALLOW_COPY_AND_ASSIGN(MenuImageSource); 80 DISALLOW_COPY_AND_ASSIGN(MenuImageSource);
80 }; 81 };
81 82
82 } // namespace 83 } // namespace
83 84
84 ExtensionInfoBar::ExtensionInfoBar( 85 ExtensionInfoBar::ExtensionInfoBar(
85 scoped_ptr<ExtensionInfoBarDelegate> delegate, 86 scoped_ptr<ExtensionInfoBarDelegate> delegate,
86 Browser* browser) 87 Browser* browser)
87 : InfoBarView(delegate.PassAs<InfoBarDelegate>()), 88 : InfoBarView(delegate.PassAs<infobars::InfoBarDelegate>()),
88 browser_(browser), 89 browser_(browser),
89 infobar_icon_(NULL), 90 infobar_icon_(NULL),
90 icon_as_menu_(NULL), 91 icon_as_menu_(NULL),
91 icon_as_image_(NULL), 92 icon_as_image_(NULL),
92 weak_ptr_factory_(this) { 93 weak_ptr_factory_(this) {
93 } 94 }
94 95
95 ExtensionInfoBar::~ExtensionInfoBar() { 96 ExtensionInfoBar::~ExtensionInfoBar() {
96 } 97 }
97 98
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 Layout(); 220 Layout();
220 } 221 }
221 222
222 ExtensionInfoBarDelegate* ExtensionInfoBar::GetDelegate() { 223 ExtensionInfoBarDelegate* ExtensionInfoBar::GetDelegate() {
223 return delegate()->AsExtensionInfoBarDelegate(); 224 return delegate()->AsExtensionInfoBarDelegate();
224 } 225 }
225 226
226 int ExtensionInfoBar::NonExtensionViewWidth() const { 227 int ExtensionInfoBar::NonExtensionViewWidth() const {
227 return infobar_icon_->width() + kIconHorizontalMargin; 228 return infobar_icon_->width() + kIconHorizontalMargin;
228 } 229 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/confirm_infobar.cc ('k') | chrome/browser/ui/views/infobars/infobar_background.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698