OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_PROVIDER_H_ | |
6 #define CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_PROVIDER_H_ | |
7 | |
8 #include "chrome/browser/extensions/location_bar_controller.h" | |
9 #include "content/public/browser/web_contents_observer.h" | |
10 | |
11 namespace content { | |
12 class BrowserContext; | |
13 class WebContents; | |
14 } | |
15 | |
16 class ExtensionAction; | |
17 | |
18 namespace extensions { | |
19 | |
20 class Extension; | |
21 class ExtensionRegistry; | |
22 | |
23 class LocationBarControllerProvider : public content::WebContentsObserver { | |
not at google - send to devlin
2014/05/07 22:49:02
This looks a lot like what LocationBarController w
Devlin
2014/05/08 18:15:46
Done.
| |
24 public: | |
25 explicit LocationBarControllerProvider(content::WebContents* web_contents); | |
26 virtual ~LocationBarControllerProvider(); | |
27 | |
28 // Returns the ExtensionActions for all extensions. | |
29 virtual std::vector<ExtensionAction*> GetCurrentActions() = 0; | |
30 | |
31 // Handles a click on an extension action. | |
32 virtual LocationBarController::Action OnClicked( | |
33 const Extension* extension, | |
34 LocationBarController::MouseButton button) = 0; | |
35 | |
36 // A notification that the WebContents has navigated (and thus, actions and | |
37 // state likely need to be refreshed). This is basically forwarded from | |
38 // WebContentsObserver::DidNavigateMainFrame(). | |
39 virtual void NavigatedMainFrame( | |
40 const content::LoadCommittedDetails& details, | |
41 const content::FrameNavigateParams& params) = 0; | |
42 | |
43 protected: | |
44 // Notifies that there has been a change, and actions need to be refreshed. | |
45 void NotifyChange(); | |
not at google - send to devlin
2014/05/07 22:49:02
it would be nice to make these protected: things a
Devlin
2014/05/08 18:15:46
Done.
| |
46 | |
47 // Returns the associated ExtensionRegistry. | |
48 ExtensionRegistry* GetExtensionRegistry(); | |
49 | |
50 content::WebContents* web_contents() { return web_contents_; } | |
51 | |
52 private: | |
53 // content::WebContentsObserver implementation. | |
54 virtual void DidNavigateMainFrame( | |
55 const content::LoadCommittedDetails& details, | |
56 const content::FrameNavigateParams& params) OVERRIDE; | |
57 | |
58 // The associated web contents. | |
59 content::WebContents* web_contents_; | |
60 | |
61 DISALLOW_COPY_AND_ASSIGN(LocationBarControllerProvider); | |
62 }; | |
63 | |
64 } // namespace extensions | |
65 | |
66 #endif // CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_PROVIDER_H_ | |
OLD | NEW |