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

Unified Diff: chrome/browser/dom_ui/search_engine_manager_handler.cc

Issue 3116023: DOMUI prefs: Fix a race condition in pushing search engine information to DOMUI (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/search_engine_manager_handler.cc
diff --git a/chrome/browser/dom_ui/search_engine_manager_handler.cc b/chrome/browser/dom_ui/search_engine_manager_handler.cc
index 18b8ab07448a0cbffedb46690fbaed3462851301..051568a712086c2413c237830224a1a9a1ad683d 100644
--- a/chrome/browser/dom_ui/search_engine_manager_handler.cc
+++ b/chrome/browser/dom_ui/search_engine_manager_handler.cc
@@ -26,7 +26,10 @@ SearchEngineManagerHandler::~SearchEngineManagerHandler() {
void SearchEngineManagerHandler::Initialize() {
controller_.reset(new KeywordEditorController(dom_ui_->GetProfile()));
- controller_->table_model()->SetObserver(this);
+ if (controller_.get()) {
+ controller_->table_model()->SetObserver(this);
+ OnModelChanged();
+ }
}
void SearchEngineManagerHandler::GetLocalizedValues(
@@ -59,6 +62,9 @@ void SearchEngineManagerHandler::RegisterMessages() {
}
void SearchEngineManagerHandler::OnModelChanged() {
+ if (!controller_->loaded())
+ return;
+
ListValue engine_list;
// Find the default engine.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698