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

Side by Side Diff: extensions/browser/guest_view/guest_view_base.h

Issue 497843002: GuestViews should be able to specify task manager entries (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More cleanup Created 6 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
OLDNEW
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_GUEST_VIEW_GUEST_VIEW_BASE_H_ 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_
7 7
8 #include <queue> 8 #include <queue>
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 // This gives the derived class an opportunity to perform some cleanup prior 138 // This gives the derived class an opportunity to perform some cleanup prior
139 // to destruction. 139 // to destruction.
140 virtual void WillDestroy() {} 140 virtual void WillDestroy() {}
141 141
142 // This method is to be implemented by the derived class. Access to guest 142 // This method is to be implemented by the derived class. Access to guest
143 // views are determined by the availability of the internal extension API 143 // views are determined by the availability of the internal extension API
144 // used to implement the guest view. 144 // used to implement the guest view.
145 // 145 //
146 // This should be the name of the API as it appears in the _api_features.json 146 // This should be the name of the API as it appears in the _api_features.json
147 // file. 147 // file.
148 virtual const char* GetAPINamespace() = 0; 148 virtual const char* GetAPINamespace() const = 0;
149
150 // This method is to be implemented by the derived class. This method is the
151 // task prefix to show for a task produced by this GuestViewBase's derived
152 // type.
153 virtual int GetTaskPrefix() const = 0;
154
155 // This method is to be implemented by the derived class. This method is the
156 // title to show for a task produced by this GuestViewBase's derived type.
157 virtual base::string16 GetTaskTitle() const;
149 158
150 // This method is to be implemented by the derived class. Given a set of 159 // This method is to be implemented by the derived class. Given a set of
151 // initialization parameters, a concrete subclass of GuestViewBase can 160 // initialization parameters, a concrete subclass of GuestViewBase can
152 // create a specialized WebContents that it returns back to GuestViewBase. 161 // create a specialized WebContents that it returns back to GuestViewBase.
153 typedef base::Callback<void(content::WebContents*)> 162 typedef base::Callback<void(content::WebContents*)>
154 WebContentsCreatedCallback; 163 WebContentsCreatedCallback;
155 virtual void CreateWebContents( 164 virtual void CreateWebContents(
156 const std::string& embedder_extension_id, 165 const std::string& embedder_extension_id,
157 int embedder_render_process_id, 166 int embedder_render_process_id,
158 const base::DictionaryValue& create_params, 167 const base::DictionaryValue& create_params,
(...skipping 13 matching lines...) Expand all
172 181
173 bool IsViewType(const char* const view_type) const { 182 bool IsViewType(const char* const view_type) const {
174 return !strcmp(GetViewType(), view_type); 183 return !strcmp(GetViewType(), view_type);
175 } 184 }
176 185
177 // Toggles autosize mode for this GuestView. 186 // Toggles autosize mode for this GuestView.
178 void SetAutoSize(bool enabled, 187 void SetAutoSize(bool enabled,
179 const gfx::Size& min_size, 188 const gfx::Size& min_size,
180 const gfx::Size& max_size); 189 const gfx::Size& max_size);
181 190
191 base::string16 GetTitle() const;
192
182 base::WeakPtr<GuestViewBase> AsWeakPtr(); 193 base::WeakPtr<GuestViewBase> AsWeakPtr();
183 194
184 bool initialized() const { return initialized_; } 195 bool initialized() const { return initialized_; }
185 196
186 content::WebContents* embedder_web_contents() const { 197 content::WebContents* embedder_web_contents() const {
187 return embedder_web_contents_; 198 return embedder_web_contents_;
188 } 199 }
189 200
190 // Returns the guest WebContents. 201 // Returns the guest WebContents.
191 content::WebContents* guest_web_contents() const { 202 content::WebContents* guest_web_contents() const {
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 // This is used to ensure pending tasks will not fire after this object is 338 // This is used to ensure pending tasks will not fire after this object is
328 // destroyed. 339 // destroyed.
329 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; 340 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_;
330 341
331 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); 342 DISALLOW_COPY_AND_ASSIGN(GuestViewBase);
332 }; 343 };
333 344
334 } // namespace extensions 345 } // namespace extensions
335 346
336 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ 347 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698