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

Side by Side Diff: chrome/browser/ui/webui/options2/password_manager_handler2.cc

Issue 9994005: Separate handler initialization from page initialization (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move anything that indirectly calls JS to InitializePage Created 8 years, 8 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
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 #include "chrome/browser/ui/webui/options2/password_manager_handler2.h" 5 #include "chrome/browser/ui/webui/options2/password_manager_handler2.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 }; 70 };
71 71
72 RegisterStrings(localized_strings, resources, arraysize(resources)); 72 RegisterStrings(localized_strings, resources, arraysize(resources));
73 RegisterTitle(localized_strings, "passwordsPage", 73 RegisterTitle(localized_strings, "passwordsPage",
74 IDS_PASSWORDS_EXCEPTIONS_WINDOW_TITLE); 74 IDS_PASSWORDS_EXCEPTIONS_WINDOW_TITLE);
75 75
76 localized_strings->SetString("passwordManagerLearnMoreURL", 76 localized_strings->SetString("passwordManagerLearnMoreURL",
77 chrome::kPasswordManagerLearnMoreURL); 77 chrome::kPasswordManagerLearnMoreURL);
78 } 78 }
79 79
80 void PasswordManagerHandler::InitializeHandler() { 80 void PasswordManagerHandler::InitializePage() {
81 // Due to the way that handlers are (re)initialized under certain types of 81 // Due to the way that handlers are (re)initialized under certain types of
82 // navigation, we may already be initialized. (See bugs 88986 and 86448.) 82 // navigation, we may already be initialized. (See bugs 88986 and 86448.)
83 // If this is the case, return immediately. This is a hack. 83 // If this is the case, return immediately. This is a hack.
84 // TODO(mdm): remove this hack once it is no longer necessary. 84 // TODO(mdm): remove this hack once it is no longer necessary.
85 if (!show_passwords_.GetPrefName().empty()) 85 if (!show_passwords_.GetPrefName().empty())
86 return; 86 return;
87 87
88 show_passwords_.Init(prefs::kPasswordManagerAllowShowPasswords, 88 show_passwords_.Init(prefs::kPasswordManagerAllowShowPasswords,
89 Profile::FromWebUI(web_ui())->GetPrefs(), this); 89 Profile::FromWebUI(web_ui())->GetPrefs(), this);
90 // We should not cache web_ui()->GetProfile(). See crosbug.com/6304. 90 // We should not cache web_ui()->GetProfile(). See crosbug.com/6304.
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 const std::vector<webkit::forms::PasswordForm*>& result) { 285 const std::vector<webkit::forms::PasswordForm*>& result) {
286 DCHECK_EQ(pending_login_query_, handle); 286 DCHECK_EQ(pending_login_query_, handle);
287 pending_login_query_ = 0; 287 pending_login_query_ = 0;
288 page_->password_exception_list_.reset(); 288 page_->password_exception_list_.reset();
289 page_->password_exception_list_.insert(page_->password_exception_list_.end(), 289 page_->password_exception_list_.insert(page_->password_exception_list_.end(),
290 result.begin(), result.end()); 290 result.begin(), result.end());
291 page_->SetPasswordExceptionList(); 291 page_->SetPasswordExceptionList();
292 } 292 }
293 293
294 } // namespace options2 294 } // namespace options2
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698