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

Unified Diff: chrome/browser/ui/webui/crashes_ui.cc

Issue 23020015: In chrome://crashes, re-read the crash list on page reload (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: In chrome://crashes, re-read the crash list on page reload Created 7 years, 3 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 | chrome/browser/upload_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/crashes_ui.cc
diff --git a/chrome/browser/ui/webui/crashes_ui.cc b/chrome/browser/ui/webui/crashes_ui.cc
index b885b013ff63318d863a8566963f3ea2c5bbc46c..e9bd5662a4262a265b9da37f430be029e5174094 100644
--- a/chrome/browser/ui/webui/crashes_ui.cc
+++ b/chrome/browser/ui/webui/crashes_ui.cc
@@ -89,13 +89,13 @@ class CrashesDOMHandler : public WebUIMessageHandler,
scoped_refptr<CrashUploadList> upload_list_;
bool list_available_;
- bool js_request_pending_;
+ bool first_load_;
DISALLOW_COPY_AND_ASSIGN(CrashesDOMHandler);
};
CrashesDOMHandler::CrashesDOMHandler()
- : list_available_(false), js_request_pending_(false) {
+ : list_available_(false), first_load_(true) {
upload_list_ = CrashUploadList::Create(this);
}
@@ -105,22 +105,24 @@ CrashesDOMHandler::~CrashesDOMHandler() {
void CrashesDOMHandler::RegisterMessages() {
upload_list_->LoadUploadListAsynchronously();
-
web_ui()->RegisterMessageCallback("requestCrashList",
base::Bind(&CrashesDOMHandler::HandleRequestCrashes,
base::Unretained(this)));
}
void CrashesDOMHandler::HandleRequestCrashes(const ListValue* args) {
Lei Zhang 2013/09/17 20:33:15 I think this should be: if (first_load_) {
achaulk1 2013/09/17 21:21:51 Ah, you're right it would do that.
- if (!CrashesUI::CrashReportingUIEnabled() || list_available_)
+ if (first_load_ && list_available_) {
UpdateUI();
- else
- js_request_pending_ = true;
+ } else {
+ list_available_ = false;
+ upload_list_->LoadUploadListAsynchronously();
+ }
+ first_load_ = false;
}
void CrashesDOMHandler::OnUploadListAvailable() {
list_available_ = true;
- if (js_request_pending_)
+ if (!first_load_)
UpdateUI();
}
« no previous file with comments | « no previous file | chrome/browser/upload_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698