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

Side by Side Diff: chrome/browser/dom_ui/options/options_ui.h

Issue 6291012: Prevent double inialization of DOMUI pref handlers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Bump copyright Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/dom_ui/options/options_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_DOM_UI_OPTIONS_OPTIONS_UI_H_ 5 #ifndef CHROME_BROWSER_DOM_UI_OPTIONS_OPTIONS_UI_H_
6 #define CHROME_BROWSER_DOM_UI_OPTIONS_OPTIONS_UI_H_ 6 #define CHROME_BROWSER_DOM_UI_OPTIONS_OPTIONS_UI_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/scoped_ptr.h" 11 #include "base/scoped_ptr.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 OptionsPageUIHandler(); 46 OptionsPageUIHandler();
47 virtual ~OptionsPageUIHandler(); 47 virtual ~OptionsPageUIHandler();
48 48
49 // Is this handler enabled? 49 // Is this handler enabled?
50 virtual bool IsEnabled(); 50 virtual bool IsEnabled();
51 51
52 // Collects localized strings for options page. 52 // Collects localized strings for options page.
53 virtual void GetLocalizedValues(DictionaryValue* localized_strings) = 0; 53 virtual void GetLocalizedValues(DictionaryValue* localized_strings) = 0;
54 54
55 // Initialize the page. Called once the DOM is available for manipulation. 55 // Initialize the page. Called once the DOM is available for manipulation.
56 // This will be called only once.
56 virtual void Initialize() {} 57 virtual void Initialize() {}
57 58
58 // Uninitializes the page. Called just before the object is destructed. 59 // Uninitializes the page. Called just before the object is destructed.
59 virtual void Uninitialize() {} 60 virtual void Uninitialize() {}
60 61
61 // DOMMessageHandler implementation. 62 // DOMMessageHandler implementation.
62 virtual void RegisterMessages() {} 63 virtual void RegisterMessages() {}
63 64
64 // NotificationObserver implementation. 65 // NotificationObserver implementation.
65 virtual void Observe(NotificationType type, 66 virtual void Observe(NotificationType type,
(...skipping 18 matching lines...) Expand all
84 virtual void RenderViewCreated(RenderViewHost* render_view_host); 85 virtual void RenderViewCreated(RenderViewHost* render_view_host);
85 virtual void DidBecomeActiveForReusedRenderView(); 86 virtual void DidBecomeActiveForReusedRenderView();
86 87
87 void InitializeHandlers(); 88 void InitializeHandlers();
88 89
89 private: 90 private:
90 // Adds OptionsPageUiHandler to the handlers list if handler is enabled. 91 // Adds OptionsPageUiHandler to the handlers list if handler is enabled.
91 void AddOptionsPageUIHandler(DictionaryValue* localized_strings, 92 void AddOptionsPageUIHandler(DictionaryValue* localized_strings,
92 OptionsPageUIHandler* handler); 93 OptionsPageUIHandler* handler);
93 94
95 bool initialized_handlers_;
96
94 DISALLOW_COPY_AND_ASSIGN(OptionsUI); 97 DISALLOW_COPY_AND_ASSIGN(OptionsUI);
95 }; 98 };
96 99
97 #endif // CHROME_BROWSER_DOM_UI_OPTIONS_OPTIONS_UI_H_ 100 #endif // CHROME_BROWSER_DOM_UI_OPTIONS_OPTIONS_UI_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/dom_ui/options/options_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698