refactor: prefer base::Contains() over find() + end() (#38443)
* refactor: use base::Contains() in KeyWeakMap::Has() * refactor: use base::Contains() in WebRequest::RequestFilter::MatchesType() * refactor: use base::Contains() in BaseWindow::AddBrowserView() * refactor: use base::Contains() in DeepFreeze() * refactor: use base::Contains() in Clipboard::Read() * Revert "refactor: use base::Contains() in BaseWindow::AddBrowserView()" This reverts commit 60152359d3978451ebdd7c8eed602c2fb8a9cafa. * refactor: use base::Contains() in BaseWindow::AddBrowserView() * refactor: use base::Contains() in IsDevToolsFileSystemAdded() * refactor: use base::Contains() in MessagePort::DisentanglePorts() * refactor: use base::Contains() in PowerSaveBlocker::IsStarted() * refactor: use base::Contains() in SpellCheckClient::OnSpellCheckDone() * refactor: use base::Contains() in ShowTaskDialogWstr() * refactor: use base::Contains() in PrintViewManagerElectron::ScriptedPrint() * refactor: use base::Contains() in PrintViewManagerElectron::DidGetPrintedPagesCount() * refactor: use base::Contains() in NativeWindow::AddDraggableRegionProvider() * refactor: use base::Contains() in ElectronBindings::ActivateUVLoop() * refactor: use base::Contains() in NativeWindowViews::IsVisibleOnAllWorkspaces() * refactor: use base::Contains() in HidChooserController::OnDeviceAdded() * refactor: use base::Contains() in ElectronSandboxedRendererClient::WillReleaseScriptContext() * refactor: use base::Contains() in ElectronRendererClient::WillDestroyWorkerContextOnWorkerThread() * refactor: use base::Contains() in GlobalShortcut::OnKeyPressed()
This commit is contained in:
parent
9640ac441d
commit
0203bd3305
19 changed files with 39 additions and 36 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/containers/contains.h"
|
||||
#include "base/containers/id_map.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/json/json_reader.h"
|
||||
|
@ -729,8 +730,8 @@ std::map<std::string, std::string> GetAddedFileSystemPaths(
|
|||
|
||||
bool IsDevToolsFileSystemAdded(content::WebContents* web_contents,
|
||||
const std::string& file_system_path) {
|
||||
auto file_system_paths = GetAddedFileSystemPaths(web_contents);
|
||||
return file_system_paths.find(file_system_path) != file_system_paths.end();
|
||||
return base::Contains(GetAddedFileSystemPaths(web_contents),
|
||||
file_system_path);
|
||||
}
|
||||
|
||||
void SetBackgroundColor(content::RenderWidgetHostView* rwhv, SkColor color) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue