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

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

Issue 1075006: Eliminate all UI thread decoding of extension images.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_VIEWS_INFOBARS_EXTENSION_INFOBAR_H_ 5 #ifndef CHROME_BROWSER_VIEWS_INFOBARS_EXTENSION_INFOBAR_H_
6 #define CHROME_BROWSER_VIEWS_INFOBARS_EXTENSION_INFOBAR_H_ 6 #define CHROME_BROWSER_VIEWS_INFOBARS_EXTENSION_INFOBAR_H_
7 7
8 #include "chrome/browser/views/infobars/infobars.h" 8 #include "chrome/browser/views/infobars/infobars.h"
9 9
10 #include "chrome/browser/extensions/image_loading_tracker.h"
10 #include "chrome/browser/views/extensions/extension_view.h" 11 #include "chrome/browser/views/extensions/extension_view.h"
11 #include "views/controls/menu/view_menu_delegate.h" 12 #include "views/controls/menu/view_menu_delegate.h"
12 13
13 class ExtensionContextMenuModel; 14 class ExtensionContextMenuModel;
14 class ExtensionInfoBarDelegate; 15 class ExtensionInfoBarDelegate;
15 16
16 namespace views { 17 namespace views {
17 class MenuButton; 18 class MenuButton;
18 class Menu2; 19 class Menu2;
19 } 20 }
20 21
21 // This class implements InfoBars for Extensions. 22 // This class implements InfoBars for Extensions.
22 class ExtensionInfoBar : public InfoBar, 23 class ExtensionInfoBar : public InfoBar,
23 public ExtensionView::Container, 24 public ExtensionView::Container,
25 public ImageLoadingTracker::Observer,
24 public views::ViewMenuDelegate { 26 public views::ViewMenuDelegate {
25 public: 27 public:
26 explicit ExtensionInfoBar(ExtensionInfoBarDelegate* delegate); 28 explicit ExtensionInfoBar(ExtensionInfoBarDelegate* delegate);
27 virtual ~ExtensionInfoBar(); 29 virtual ~ExtensionInfoBar();
28 30
29 // Overridden from ExtensionView::Container: 31 // Overridden from ExtensionView::Container:
30 virtual void OnExtensionMouseEvent(ExtensionView* view) {} 32 virtual void OnExtensionMouseEvent(ExtensionView* view) {}
31 virtual void OnExtensionMouseLeave(ExtensionView* view) {} 33 virtual void OnExtensionMouseLeave(ExtensionView* view) {}
32 virtual void OnExtensionPreferredSizeChanged(ExtensionView* view); 34 virtual void OnExtensionPreferredSizeChanged(ExtensionView* view);
33 35
34 // Overridden from views::View: 36 // Overridden from views::View:
35 virtual void Layout(); 37 virtual void Layout();
36 38
39 // Overridden from ImageLoadingTracker::Observer:
40 virtual void OnImageLoaded(SkBitmap* image, int index);
41
37 // Overridden from views::ViewMenuDelegate: 42 // Overridden from views::ViewMenuDelegate:
38 virtual void RunMenu(View* source, const gfx::Point& pt); 43 virtual void RunMenu(View* source, const gfx::Point& pt);
39 44
40 private: 45 private:
41 // Setup the menu button showing the small extension icon and its dropdown 46 // Setup the menu button showing the small extension icon and its dropdown
42 // menu. 47 // menu.
43 void SetupIconAndMenu(); 48 void SetupIconAndMenu();
44 49
45 NotificationRegistrar notification_registrar_; 50 NotificationRegistrar notification_registrar_;
46 51
47 ExtensionInfoBarDelegate* delegate_; 52 ExtensionInfoBarDelegate* delegate_;
48 53
49 // The dropdown menu for accessing the contextual extension actions. 54 // The dropdown menu for accessing the contextual extension actions.
50 scoped_ptr<ExtensionContextMenuModel> options_menu_contents_; 55 scoped_ptr<ExtensionContextMenuModel> options_menu_contents_;
51 scoped_ptr<views::Menu2> options_menu_menu_; 56 scoped_ptr<views::Menu2> options_menu_menu_;
52 views::MenuButton* menu_; 57 views::MenuButton* menu_;
53 58
59 // Keeps track of images being loaded on the File thread.
60 ImageLoadingTracker tracker_;
61
54 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBar); 62 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBar);
55 }; 63 };
56 64
57 #endif // CHROME_BROWSER_VIEWS_INFOBARS_EXTENSION_INFOBAR_H_ 65 #endif // CHROME_BROWSER_VIEWS_INFOBARS_EXTENSION_INFOBAR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698