| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 EXTENSIONS_BROWSER_EXTENSION_HOST_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_HOST_H_ |
| 6 #define EXTENSIONS_BROWSER_EXTENSION_HOST_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 // Returns true if the render view is initialized and didn't crash. | 70 // Returns true if the render view is initialized and didn't crash. |
| 71 bool IsRenderViewLive() const; | 71 bool IsRenderViewLive() const; |
| 72 | 72 |
| 73 // Prepares to initializes our RenderViewHost by creating its RenderView and | 73 // Prepares to initializes our RenderViewHost by creating its RenderView and |
| 74 // navigating to this host's url. Uses host_view for the RenderViewHost's view | 74 // navigating to this host's url. Uses host_view for the RenderViewHost's view |
| 75 // (can be NULL). This happens delayed to avoid locking the UI. | 75 // (can be NULL). This happens delayed to avoid locking the UI. |
| 76 void CreateRenderViewSoon(); | 76 void CreateRenderViewSoon(); |
| 77 | 77 |
| 78 // content::WebContentsObserver | 78 // content::WebContentsObserver |
| 79 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 79 virtual bool OnMessageReceived(const IPC::Message& message) override; |
| 80 virtual void RenderViewCreated( | 80 virtual void RenderViewCreated( |
| 81 content::RenderViewHost* render_view_host) OVERRIDE; | 81 content::RenderViewHost* render_view_host) override; |
| 82 virtual void RenderViewDeleted( | 82 virtual void RenderViewDeleted( |
| 83 content::RenderViewHost* render_view_host) OVERRIDE; | 83 content::RenderViewHost* render_view_host) override; |
| 84 virtual void RenderViewReady() OVERRIDE; | 84 virtual void RenderViewReady() override; |
| 85 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; | 85 virtual void RenderProcessGone(base::TerminationStatus status) override; |
| 86 virtual void DocumentAvailableInMainFrame() OVERRIDE; | 86 virtual void DocumentAvailableInMainFrame() override; |
| 87 virtual void DidStopLoading( | 87 virtual void DidStopLoading( |
| 88 content::RenderViewHost* render_view_host) OVERRIDE; | 88 content::RenderViewHost* render_view_host) override; |
| 89 | 89 |
| 90 // content::WebContentsDelegate | 90 // content::WebContentsDelegate |
| 91 virtual content::JavaScriptDialogManager* | 91 virtual content::JavaScriptDialogManager* |
| 92 GetJavaScriptDialogManager() OVERRIDE; | 92 GetJavaScriptDialogManager() override; |
| 93 virtual void AddNewContents(content::WebContents* source, | 93 virtual void AddNewContents(content::WebContents* source, |
| 94 content::WebContents* new_contents, | 94 content::WebContents* new_contents, |
| 95 WindowOpenDisposition disposition, | 95 WindowOpenDisposition disposition, |
| 96 const gfx::Rect& initial_pos, | 96 const gfx::Rect& initial_pos, |
| 97 bool user_gesture, | 97 bool user_gesture, |
| 98 bool* was_blocked) OVERRIDE; | 98 bool* was_blocked) override; |
| 99 virtual void CloseContents(content::WebContents* contents) OVERRIDE; | 99 virtual void CloseContents(content::WebContents* contents) override; |
| 100 virtual void RequestMediaAccessPermission( | 100 virtual void RequestMediaAccessPermission( |
| 101 content::WebContents* web_contents, | 101 content::WebContents* web_contents, |
| 102 const content::MediaStreamRequest& request, | 102 const content::MediaStreamRequest& request, |
| 103 const content::MediaResponseCallback& callback) OVERRIDE; | 103 const content::MediaResponseCallback& callback) override; |
| 104 virtual bool CheckMediaAccessPermission( | 104 virtual bool CheckMediaAccessPermission( |
| 105 content::WebContents* web_contents, | 105 content::WebContents* web_contents, |
| 106 const GURL& security_origin, | 106 const GURL& security_origin, |
| 107 content::MediaStreamType type) OVERRIDE; | 107 content::MediaStreamType type) override; |
| 108 virtual bool IsNeverVisible(content::WebContents* web_contents) OVERRIDE; | 108 virtual bool IsNeverVisible(content::WebContents* web_contents) override; |
| 109 | 109 |
| 110 // content::NotificationObserver | 110 // content::NotificationObserver |
| 111 virtual void Observe(int type, | 111 virtual void Observe(int type, |
| 112 const content::NotificationSource& source, | 112 const content::NotificationSource& source, |
| 113 const content::NotificationDetails& details) OVERRIDE; | 113 const content::NotificationDetails& details) override; |
| 114 | 114 |
| 115 protected: | 115 protected: |
| 116 content::NotificationRegistrar* registrar() { return ®istrar_; } | 116 content::NotificationRegistrar* registrar() { return ®istrar_; } |
| 117 | 117 |
| 118 // Called after the extension page finishes loading but before the | 118 // Called after the extension page finishes loading but before the |
| 119 // EXTENSION_HOST_DID_STOP_LOADING notification is sent. | 119 // EXTENSION_HOST_DID_STOP_LOADING notification is sent. |
| 120 virtual void OnDidStopLoading(); | 120 virtual void OnDidStopLoading(); |
| 121 | 121 |
| 122 // Called once when the document first becomes available. | 122 // Called once when the document first becomes available. |
| 123 virtual void OnDocumentAvailable(); | 123 virtual void OnDocumentAvailable(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 181 |
| 182 // Used to measure how long it's been since the host was created. | 182 // Used to measure how long it's been since the host was created. |
| 183 base::ElapsedTimer since_created_; | 183 base::ElapsedTimer since_created_; |
| 184 | 184 |
| 185 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); | 185 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); |
| 186 }; | 186 }; |
| 187 | 187 |
| 188 } // namespace extensions | 188 } // namespace extensions |
| 189 | 189 |
| 190 #endif // EXTENSIONS_BROWSER_EXTENSION_HOST_H_ | 190 #endif // EXTENSIONS_BROWSER_EXTENSION_HOST_H_ |
| OLD | NEW |