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

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

Issue 8068020: Converts usage of GetBrowserViewForNativeWindow to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks Created 9 years, 2 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) 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;
35 virtual int ContentMinimumWidth() const OVERRIDE; 37 virtual int ContentMinimumWidth() const OVERRIDE;
36 38
37 // ImageLoadingTracker::Observer: 39 // ImageLoadingTracker::Observer:
38 virtual void OnImageLoaded(SkBitmap* image, 40 virtual void OnImageLoaded(SkBitmap* image,
39 const ExtensionResource& resource, 41 const ExtensionResource& resource,
40 int index); 42 int index);
41 43
42 // ExtensionInfoBarDelegate::DelegateObserver: 44 // ExtensionInfoBarDelegate::DelegateObserver:
43 virtual void OnDelegateDeleted(); 45 virtual void OnDelegateDeleted();
44 46
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
52 Browser* browser_;
53
50 // TODO(pkasting): This shadows InfoBarView::delegate_. Get rid of this once 54 // TODO(pkasting): This shadows InfoBarView::delegate_. Get rid of this once
51 // InfoBars own their delegates (and thus we don't need the DelegateObserver 55 // InfoBars own their delegates (and thus we don't need the DelegateObserver
52 // functionality). For now, almost everyone should use GetDelegate() instead. 56 // functionality). For now, almost everyone should use GetDelegate() instead.
53 InfoBarDelegate* delegate_; 57 InfoBarDelegate* delegate_;
54 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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698