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

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

Issue 10830353: Introduce InfoBarTabService API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments, merge to LKGR Created 8 years, 4 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/infobars/infobar_tab_helper.h"
10 #include "chrome/browser/platform_util.h" 11 #include "chrome/browser/platform_util.h"
11 #include "chrome/browser/ui/views/frame/browser_view.h" 12 #include "chrome/browser/ui/views/frame/browser_view.h"
12 #include "chrome/common/extensions/extension.h" 13 #include "chrome/common/extensions/extension.h"
13 #include "chrome/common/extensions/extension_constants.h" 14 #include "chrome/common/extensions/extension_constants.h"
14 #include "chrome/common/extensions/extension_icon_set.h" 15 #include "chrome/common/extensions/extension_icon_set.h"
15 #include "chrome/common/extensions/extension_resource.h" 16 #include "chrome/common/extensions/extension_resource.h"
16 #include "grit/theme_resources.h" 17 #include "grit/theme_resources.h"
17 #include "ui/base/animation/slide_animation.h" 18 #include "ui/base/animation/slide_animation.h"
18 #include "ui/base/resource/resource_bundle.h" 19 #include "ui/base/resource/resource_bundle.h"
19 #include "ui/gfx/canvas.h" 20 #include "ui/gfx/canvas.h"
20 #include "ui/gfx/image/canvas_image_source.h" 21 #include "ui/gfx/image/canvas_image_source.h"
21 #include "ui/gfx/image/image.h" 22 #include "ui/gfx/image/image.h"
22 #include "ui/views/controls/button/menu_button.h" 23 #include "ui/views/controls/button/menu_button.h"
23 #include "ui/views/controls/menu/menu_item_view.h" 24 #include "ui/views/controls/menu/menu_item_view.h"
24 #include "ui/views/widget/widget.h" 25 #include "ui/views/widget/widget.h"
25 26
26 // ExtensionInfoBarDelegate ---------------------------------------------------- 27 // ExtensionInfoBarDelegate ----------------------------------------------------
27 28
28 InfoBar* ExtensionInfoBarDelegate::CreateInfoBar(InfoBarTabHelper* owner) { 29 InfoBar* ExtensionInfoBarDelegate::CreateInfoBar(InfoBarTabService* owner) {
29 return new ExtensionInfoBar(browser_, owner, this); 30 return new ExtensionInfoBar(
31 browser_, static_cast<InfoBarTabHelper*>(owner), this);
30 } 32 }
31 33
32 // ExtensionInfoBar ------------------------------------------------------------ 34 // ExtensionInfoBar ------------------------------------------------------------
33 35
34 namespace { 36 namespace {
35 // The horizontal margin between the menu and the Extension (HTML) view. 37 // The horizontal margin between the menu and the Extension (HTML) view.
36 const int kMenuHorizontalMargin = 1; 38 const int kMenuHorizontalMargin = 1;
37 39
38 class MenuImageSource: public gfx::CanvasImageSource { 40 class MenuImageSource: public gfx::CanvasImageSource {
39 public: 41 public:
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 184
183 scoped_refptr<ExtensionContextMenuModel> options_menu_contents = 185 scoped_refptr<ExtensionContextMenuModel> options_menu_contents =
184 new ExtensionContextMenuModel(extension, browser_); 186 new ExtensionContextMenuModel(extension, browser_);
185 DCHECK_EQ(menu_, source); 187 DCHECK_EQ(menu_, source);
186 RunMenuAt(options_menu_contents.get(), menu_, views::MenuItemView::TOPLEFT); 188 RunMenuAt(options_menu_contents.get(), menu_, views::MenuItemView::TOPLEFT);
187 } 189 }
188 190
189 ExtensionInfoBarDelegate* ExtensionInfoBar::GetDelegate() { 191 ExtensionInfoBarDelegate* ExtensionInfoBar::GetDelegate() {
190 return delegate_ ? delegate_->AsExtensionInfoBarDelegate() : NULL; 192 return delegate_ ? delegate_->AsExtensionInfoBarDelegate() : NULL;
191 } 193 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/confirm_infobar.cc ('k') | chrome/browser/ui/views/infobars/link_infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698