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

Unified Diff: chrome/browser/dom_ui/dom_ui.h

Issue 131094: Add GetMessageHandlers to HtmlDialogUIDelegate to allow... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/dom_ui/debugger_ui.cc ('k') | chrome/browser/dom_ui/dom_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/dom_ui.h
===================================================================
--- chrome/browser/dom_ui/dom_ui.h (revision 19317)
+++ chrome/browser/dom_ui/dom_ui.h (working copy)
@@ -129,9 +129,13 @@
// host is destroyed.
class DOMMessageHandler {
public:
- explicit DOMMessageHandler(DOMUI* dom_ui);
+ DOMMessageHandler() : dom_ui_(NULL) { }
virtual ~DOMMessageHandler() {};
+ // Attaches |this| to |dom_ui| in order to handle messages from it. Declared
+ // virtual so that subclasses can do special init work as soon as the dom_ui
+ // is provided. Returns |this| for convenience.
+ virtual DOMMessageHandler* Attach(DOMUI* dom_ui);
protected:
// Adds "url" and "title" keys on incoming dictionary, setting title
// as the url as a fallback on empty title.
@@ -139,13 +143,16 @@
std::wstring title,
const GURL& gurl);
+ // This is where subclasses specify which messages they'd like to handle.
+ virtual void RegisterMessages() = 0;
+
// Extract an integer value from a Value.
bool ExtractIntegerValue(const Value* value, int* out_int);
// Extract a string value from a Value.
std::wstring ExtractStringValue(const Value* value);
- DOMUI* const dom_ui_;
+ DOMUI* dom_ui_;
private:
DISALLOW_COPY_AND_ASSIGN(DOMMessageHandler);
« no previous file with comments | « chrome/browser/dom_ui/debugger_ui.cc ('k') | chrome/browser/dom_ui/dom_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698