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

Side by Side Diff: chrome/browser/extensions/page_action_controller.h

Issue 10911105: Switch ScriptBadgeController and PageActionController to use WebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/extensions/page_action_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
11 #include "base/observer_list.h" 11 #include "base/observer_list.h"
12 #include "chrome/browser/extensions/location_bar_controller.h" 12 #include "chrome/browser/extensions/location_bar_controller.h"
13 #include "content/public/browser/web_contents_observer.h" 13 #include "content/public/browser/web_contents_observer.h"
14 14
15 class ExtensionService; 15 class ExtensionService;
16 class TabContents;
17 16
18 namespace extensions { 17 namespace extensions {
19 18
20 // A LocationBarController which populates the location bar with icons based 19 // A LocationBarController which populates the location bar with icons based
21 // on the page_action extension API. 20 // on the page_action extension API.
22 class PageActionController : public LocationBarController, 21 class PageActionController : public LocationBarController,
23 public content::WebContentsObserver { 22 public content::WebContentsObserver {
24 public: 23 public:
25 explicit PageActionController(TabContents* tab_contents); 24 explicit PageActionController(content::WebContents* web_contents);
Aaron Boodman 2012/09/05 22:02:00 General comment. It is really important that all o
26 virtual ~PageActionController(); 25 virtual ~PageActionController();
27 26
28 // LocationBarController implementation. 27 // LocationBarController implementation.
29 virtual std::vector<ExtensionAction*> GetCurrentActions() const OVERRIDE; 28 virtual std::vector<ExtensionAction*> GetCurrentActions() const OVERRIDE;
30 // Page actions can't try to get attention. 29 // Page actions can't try to get attention.
31 virtual void GetAttentionFor(const std::string& extension_id) OVERRIDE {} 30 virtual void GetAttentionFor(const std::string& extension_id) OVERRIDE {}
32 virtual Action OnClicked(const std::string& extension_id, 31 virtual Action OnClicked(const std::string& extension_id,
33 int mouse_button) OVERRIDE; 32 int mouse_button) OVERRIDE;
34 virtual void NotifyChange() OVERRIDE; 33 virtual void NotifyChange() OVERRIDE;
35 34
36 // content::WebContentsObserver implementation. 35 // content::WebContentsObserver implementation.
37 virtual void DidNavigateMainFrame( 36 virtual void DidNavigateMainFrame(
38 const content::LoadCommittedDetails& details, 37 const content::LoadCommittedDetails& details,
39 const content::FrameNavigateParams& params) OVERRIDE; 38 const content::FrameNavigateParams& params) OVERRIDE;
40 39
41 private: 40 private:
42 // Gets the ExtensionService for |tab_contents_|. 41 // Gets the ExtensionService for the web contents.
43 ExtensionService* GetExtensionService() const; 42 ExtensionService* GetExtensionService() const;
44 43
45 TabContents* tab_contents_;
46
47 DISALLOW_COPY_AND_ASSIGN(PageActionController); 44 DISALLOW_COPY_AND_ASSIGN(PageActionController);
48 }; 45 };
49 46
50 } // namespace extensions 47 } // namespace extensions
51 48
52 #endif // CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_ 49 #endif // CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/page_action_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698