| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_VIEWS_INFOBARS_EXTENSION_INFOBAR_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_INFOBARS_EXTENSION_INFOBAR_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_EXTENSION_INFOBAR_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_EXTENSION_INFOBAR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/extensions/extension_infobar_delegate.h" | 9 #include "chrome/browser/extensions/extension_infobar_delegate.h" |
| 10 #include "chrome/browser/extensions/image_loading_tracker.h" | 10 #include "chrome/browser/extensions/image_loading_tracker.h" |
| 11 #include "chrome/browser/ui/views/infobars/infobar_view.h" | 11 #include "chrome/browser/ui/views/infobars/infobar_view.h" |
| 12 #include "views/controls/menu/view_menu_delegate.h" | 12 #include "views/controls/menu/view_menu_delegate.h" |
| 13 | 13 |
| 14 class Browser; |
| 14 class TabContentsWrapper; | 15 class TabContentsWrapper; |
| 15 namespace views { | 16 namespace views { |
| 16 class MenuButton; | 17 class MenuButton; |
| 17 } | 18 } |
| 18 | 19 |
| 19 class ExtensionInfoBar : public InfoBarView, | 20 class ExtensionInfoBar : public InfoBarView, |
| 20 public ImageLoadingTracker::Observer, | 21 public ImageLoadingTracker::Observer, |
| 21 public ExtensionInfoBarDelegate::DelegateObserver, | 22 public ExtensionInfoBarDelegate::DelegateObserver, |
| 22 public views::ViewMenuDelegate { | 23 public views::ViewMenuDelegate { |
| 23 public: | 24 public: |
| 24 ExtensionInfoBar(TabContentsWrapper* owner, | 25 ExtensionInfoBar(Browser* browser, |
| 26 TabContentsWrapper* owner, |
| 25 ExtensionInfoBarDelegate* delegate); | 27 ExtensionInfoBarDelegate* delegate); |
| 26 | 28 |
| 27 private: | 29 private: |
| 28 virtual ~ExtensionInfoBar(); | 30 virtual ~ExtensionInfoBar(); |
| 29 | 31 |
| 30 // InfoBarView: | 32 // InfoBarView: |
| 31 virtual void Layout() OVERRIDE; | 33 virtual void Layout() OVERRIDE; |
| 32 virtual void ViewHierarchyChanged(bool is_add, | 34 virtual void ViewHierarchyChanged(bool is_add, |
| 33 View* parent, | 35 View* parent, |
| 34 View* child) OVERRIDE; | 36 View* child) OVERRIDE; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 45 // views::ViewMenuDelegate: | 47 // views::ViewMenuDelegate: |
| 46 virtual void RunMenu(View* source, const gfx::Point& pt); | 48 virtual void RunMenu(View* source, const gfx::Point& pt); |
| 47 | 49 |
| 48 ExtensionInfoBarDelegate* GetDelegate(); | 50 ExtensionInfoBarDelegate* GetDelegate(); |
| 49 | 51 |
| 50 // TODO(pkasting): This shadows InfoBarView::delegate_. Get rid of this once | 52 // TODO(pkasting): This shadows InfoBarView::delegate_. Get rid of this once |
| 51 // InfoBars own their delegates (and thus we don't need the DelegateObserver | 53 // InfoBars own their delegates (and thus we don't need the DelegateObserver |
| 52 // functionality). For now, almost everyone should use GetDelegate() instead. | 54 // functionality). For now, almost everyone should use GetDelegate() instead. |
| 53 InfoBarDelegate* delegate_; | 55 InfoBarDelegate* delegate_; |
| 54 | 56 |
| 57 Browser* browser_; |
| 58 |
| 55 // The dropdown menu for accessing the contextual extension actions. | 59 // The dropdown menu for accessing the contextual extension actions. |
| 56 views::MenuButton* menu_; | 60 views::MenuButton* menu_; |
| 57 | 61 |
| 58 // Keeps track of images being loaded on the File thread. | 62 // Keeps track of images being loaded on the File thread. |
| 59 ImageLoadingTracker tracker_; | 63 ImageLoadingTracker tracker_; |
| 60 | 64 |
| 61 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBar); | 65 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBar); |
| 62 }; | 66 }; |
| 63 | 67 |
| 64 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_EXTENSION_INFOBAR_H_ | 68 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_EXTENSION_INFOBAR_H_ |
| OLD | NEW |