| OLD | NEW | 
|    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/conflicts_ui.h" |    5 #include "chrome/browser/ui/webui/conflicts_ui.h" | 
|    6  |    6  | 
|    7 #if defined(OS_WIN) |    7 #if defined(OS_WIN) | 
|    8  |    8  | 
|    9 #include <string> |    9 #include <string> | 
|   10  |   10  | 
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  115  |  115  | 
|  116 void ConflictsDOMHandler::HandleRequestModuleList(const base::ListValue* args) { |  116 void ConflictsDOMHandler::HandleRequestModuleList(const base::ListValue* args) { | 
|  117   // The request is handled asynchronously, and will callback via |  117   // The request is handled asynchronously, and will callback via | 
|  118   // OnScanCompleted on completion. |  118   // OnScanCompleted on completion. | 
|  119   auto* model = EnumerateModulesModel::GetInstance(); |  119   auto* model = EnumerateModulesModel::GetInstance(); | 
|  120  |  120  | 
|  121   // The JS shouldn't be abusive and call 'requestModuleList' twice, but it's |  121   // The JS shouldn't be abusive and call 'requestModuleList' twice, but it's | 
|  122   // easy enough to defend against this. |  122   // easy enough to defend against this. | 
|  123   if (!observer_.IsObserving(model)) { |  123   if (!observer_.IsObserving(model)) { | 
|  124     observer_.Add(model); |  124     observer_.Add(model); | 
|  125     model->ScanNow(); |  125  | 
 |  126     // Ask the scan to be performed immediately, and not in background mode. | 
 |  127     // This ensures the results are available ASAP for the UI. | 
 |  128     model->ScanNow(false); | 
|  126   } |  129   } | 
|  127 } |  130 } | 
|  128  |  131  | 
|  129 void ConflictsDOMHandler::SendModuleList() { |  132 void ConflictsDOMHandler::SendModuleList() { | 
|  130   auto* loaded_modules = EnumerateModulesModel::GetInstance(); |  133   auto* loaded_modules = EnumerateModulesModel::GetInstance(); | 
|  131   base::ListValue* list = loaded_modules->GetModuleList(); |  134   base::ListValue* list = loaded_modules->GetModuleList(); | 
|  132   base::DictionaryValue results; |  135   base::DictionaryValue results; | 
|  133   results.Set("moduleList", list); |  136   results.Set("moduleList", list); | 
|  134  |  137  | 
|  135   // Add the section title and the total count for bad modules found. |  138   // Add the section title and the total count for bad modules found. | 
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  176  |  179  | 
|  177 // static |  180 // static | 
|  178 base::RefCountedMemory* ConflictsUI::GetFaviconResourceBytes( |  181 base::RefCountedMemory* ConflictsUI::GetFaviconResourceBytes( | 
|  179       ui::ScaleFactor scale_factor) { |  182       ui::ScaleFactor scale_factor) { | 
|  180   return static_cast<base::RefCountedMemory*>( |  183   return static_cast<base::RefCountedMemory*>( | 
|  181       ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( |  184       ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( | 
|  182           IDR_CONFLICT_FAVICON, scale_factor)); |  185           IDR_CONFLICT_FAVICON, scale_factor)); | 
|  183 } |  186 } | 
|  184  |  187  | 
|  185 #endif |  188 #endif | 
| OLD | NEW |