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

Side by Side Diff: content/public/browser/web_contents_delegate.h

Issue 691823002: Add WebContents source to methods in WebContentsDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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) 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 CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 169
170 // Return the rect where to display the resize corner, if any, otherwise 170 // Return the rect where to display the resize corner, if any, otherwise
171 // an empty rect. 171 // an empty rect.
172 virtual gfx::Rect GetRootWindowResizerRect() const; 172 virtual gfx::Rect GetRootWindowResizerRect() const;
173 173
174 // Invoked prior to showing before unload handler confirmation dialog. 174 // Invoked prior to showing before unload handler confirmation dialog.
175 virtual void WillRunBeforeUnloadConfirm() {} 175 virtual void WillRunBeforeUnloadConfirm() {}
176 176
177 // Returns true if javascript dialogs and unload alerts are suppressed. 177 // Returns true if javascript dialogs and unload alerts are suppressed.
178 // Default is false. 178 // Default is false.
179 virtual bool ShouldSuppressDialogs(); 179 virtual bool ShouldSuppressDialogs(WebContents* source);
180 180
181 // Returns whether pending NavigationEntries for aborted browser-initiated 181 // Returns whether pending NavigationEntries for aborted browser-initiated
182 // navigations should be preserved (and thus returned from GetVisibleURL). 182 // navigations should be preserved (and thus returned from GetVisibleURL).
183 // Defaults to false. 183 // Defaults to false.
184 virtual bool ShouldPreserveAbortedURLs(WebContents* source); 184 virtual bool ShouldPreserveAbortedURLs(WebContents* source);
185 185
186 // Add a message to the console. Returning true indicates that the delegate 186 // Add a message to the console. Returning true indicates that the delegate
187 // handled the message. If false is returned the default logging mechanism 187 // handled the message. If false is returned the default logging mechanism
188 // will be used for the message. 188 // will be used for the message.
189 virtual bool AddMessageToConsole(WebContents* source, 189 virtual bool AddMessageToConsole(WebContents* source,
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 // Invoked when a main fram navigation occurs. 335 // Invoked when a main fram navigation occurs.
336 virtual void DidNavigateMainFramePostCommit(WebContents* source) {} 336 virtual void DidNavigateMainFramePostCommit(WebContents* source) {}
337 337
338 // Invoked when navigating to a pending entry. When invoked the 338 // Invoked when navigating to a pending entry. When invoked the
339 // NavigationController has configured its pending entry, but it has not yet 339 // NavigationController has configured its pending entry, but it has not yet
340 // been committed. 340 // been committed.
341 virtual void DidNavigateToPendingEntry(WebContents* source) {} 341 virtual void DidNavigateToPendingEntry(WebContents* source) {}
342 342
343 // Returns a pointer to a service to manage JavaScript dialogs. May return 343 // Returns a pointer to a service to manage JavaScript dialogs. May return
344 // NULL in which case dialogs aren't shown. 344 // NULL in which case dialogs aren't shown.
345 virtual JavaScriptDialogManager* GetJavaScriptDialogManager(); 345 virtual JavaScriptDialogManager* GetJavaScriptDialogManager(
346 WebContents* source);
346 347
347 // Called when color chooser should open. Returns the opened color chooser. 348 // Called when color chooser should open. Returns the opened color chooser.
348 // Returns NULL if we failed to open the color chooser (e.g. when there is a 349 // Returns NULL if we failed to open the color chooser (e.g. when there is a
349 // ColorChooserDialog already open on Windows). Ownership of the returned 350 // ColorChooserDialog already open on Windows). Ownership of the returned
350 // pointer is transferred to the caller. 351 // pointer is transferred to the caller.
351 virtual ColorChooser* OpenColorChooser( 352 virtual ColorChooser* OpenColorChooser(
352 WebContents* web_contents, 353 WebContents* web_contents,
353 SkColor color, 354 SkColor color,
354 const std::vector<ColorSuggestion>& suggestions); 355 const std::vector<ColorSuggestion>& suggestions);
355 356
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 // Called when |this| is no longer the WebContentsDelegate for |source|. 500 // Called when |this| is no longer the WebContentsDelegate for |source|.
500 void Detach(WebContents* source); 501 void Detach(WebContents* source);
501 502
502 // The WebContents that this is currently a delegate for. 503 // The WebContents that this is currently a delegate for.
503 std::set<WebContents*> attached_contents_; 504 std::set<WebContents*> attached_contents_;
504 }; 505 };
505 506
506 } // namespace content 507 } // namespace content
507 508
508 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ 509 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/public/browser/web_contents_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698