 Chromium Code Reviews
 Chromium Code Reviews Issue 23020015:
  In chrome://crashes, re-read the crash list on page reload  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 23020015:
  In chrome://crashes, re-read the crash list on page reload  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| 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(); | 
| } |