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

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

Issue 1627024: Add ExtensionFunctionDispatcher::Delegate::GetAssociatedTabContents (Closed)
Patch Set: cr changes Created 10 years, 8 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
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_EXTENSIONS_EXTENSION_HOST_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/perftimer.h" 10 #include "base/perftimer.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 SiteInstance* site_instance() const; 75 SiteInstance* site_instance() const;
76 bool did_stop_loading() const { return did_stop_loading_; } 76 bool did_stop_loading() const { return did_stop_loading_; }
77 bool document_element_available() const { 77 bool document_element_available() const {
78 return document_element_available_; 78 return document_element_available_;
79 } 79 }
80 80
81 Profile* profile() const { return profile_; } 81 Profile* profile() const { return profile_; }
82 82
83 ViewType::Type extension_host_type() const { return extension_host_type_; } 83 ViewType::Type extension_host_type() const { return extension_host_type_; }
84 84
85 // ExtensionFunctionDispatcher::Delegate
86 virtual TabContents* associated_tab_contents() {
87 return associated_tab_contents_;
88 }
89 void set_associated_tab_contents(TabContents* associated_tab_contents) {
90 associated_tab_contents_ = associated_tab_contents;
91 }
92
85 // Sets the the ViewType of this host (e.g. mole, toolstrip). 93 // Sets the the ViewType of this host (e.g. mole, toolstrip).
86 void SetRenderViewType(ViewType::Type type); 94 void SetRenderViewType(ViewType::Type type);
87 95
88 // Returns true if the render view is initialized and didn't crash. 96 // Returns true if the render view is initialized and didn't crash.
89 bool IsRenderViewLive() const; 97 bool IsRenderViewLive() const;
90 98
91 // Prepares to initializes our RenderViewHost by creating its RenderView and 99 // Prepares to initializes our RenderViewHost by creating its RenderView and
92 // navigating to this host's url. Uses host_view for the RenderViewHost's view 100 // navigating to this host's url. Uses host_view for the RenderViewHost's view
93 // (can be NULL). This happens delayed to avoid locking the UI. 101 // (can be NULL). This happens delayed to avoid locking the UI.
94 void CreateRenderViewSoon(RenderWidgetHostView* host_view); 102 void CreateRenderViewSoon(RenderWidgetHostView* host_view);
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 GURL url_; 254 GURL url_;
247 255
248 NotificationRegistrar registrar_; 256 NotificationRegistrar registrar_;
249 257
250 scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; 258 scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_;
251 259
252 // Only EXTENSION_TOOLSTRIP, EXTENSION_POPUP, and EXTENSION_BACKGROUND_PAGE 260 // Only EXTENSION_TOOLSTRIP, EXTENSION_POPUP, and EXTENSION_BACKGROUND_PAGE
253 // are used here, others are not hosted by ExtensionHost. 261 // are used here, others are not hosted by ExtensionHost.
254 ViewType::Type extension_host_type_; 262 ViewType::Type extension_host_type_;
255 263
264 // The relevant TabContents associated with this ExtensionHost, if any.
265 TabContents* associated_tab_contents_;
266
256 // Used to measure how long it's been since the host was created. 267 // Used to measure how long it's been since the host was created.
257 PerfTimer since_created_; 268 PerfTimer since_created_;
258 269
259 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); 270 DISALLOW_COPY_AND_ASSIGN(ExtensionHost);
260 }; 271 };
261 272
262 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ 273 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_function_dispatcher.h ('k') | chrome/browser/extensions/extension_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698