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

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

Issue 10695070: Implement scriptBadge.requestToAct. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 8 years, 5 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 #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; 16 class TabContents;
17 17
18 namespace extensions { 18 namespace extensions {
19 19
20 // A LocationBarController which populates the location bar with icons based 20 // A LocationBarController which populates the location bar with icons based
21 // on the page_action extension API. 21 // on the page_action extension API.
22 class PageActionController : public LocationBarController, 22 class PageActionController : public LocationBarController,
23 public content::WebContentsObserver { 23 public content::WebContentsObserver {
24 public: 24 public:
25 explicit PageActionController(TabContents* tab_contents); 25 explicit PageActionController(TabContents* tab_contents);
26 virtual ~PageActionController(); 26 virtual ~PageActionController();
27 27
28 // LocationBarController implementation. 28 // LocationBarController implementation.
29 virtual std::vector<ExtensionAction*> GetCurrentActions() const OVERRIDE; 29 virtual std::vector<ExtensionAction*> GetCurrentActions() const OVERRIDE;
30 // Page actions can't try to get attention.
31 virtual void GetAttentionFor(const std::string& extension_id) OVERRIDE {}
30 virtual Action OnClicked(const std::string& extension_id, 32 virtual Action OnClicked(const std::string& extension_id,
31 int mouse_button) OVERRIDE; 33 int mouse_button) OVERRIDE;
32 virtual void NotifyChange() OVERRIDE; 34 virtual void NotifyChange() OVERRIDE;
33 35
34 // content::WebContentsObserver implementation. 36 // content::WebContentsObserver implementation.
35 virtual void DidNavigateMainFrame( 37 virtual void DidNavigateMainFrame(
36 const content::LoadCommittedDetails& details, 38 const content::LoadCommittedDetails& details,
37 const content::FrameNavigateParams& params) OVERRIDE; 39 const content::FrameNavigateParams& params) OVERRIDE;
38 40
39 private: 41 private:
40 // Gets the ExtensionService for |tab_contents_|. 42 // Gets the ExtensionService for |tab_contents_|.
41 ExtensionService* GetExtensionService() const; 43 ExtensionService* GetExtensionService() const;
42 44
43 TabContents* tab_contents_; 45 TabContents* tab_contents_;
44 46
45 DISALLOW_COPY_AND_ASSIGN(PageActionController); 47 DISALLOW_COPY_AND_ASSIGN(PageActionController);
46 }; 48 };
47 49
48 } // namespace extensions 50 } // namespace extensions
49 51
50 #endif // CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_ 52 #endif // CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/location_bar_controller.h ('k') | chrome/browser/extensions/script_badge_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698