Use std::string_view in PrefStore::Observer.

Bug: 349741884
Change-Id: Ifa66cb4a47c17864247eee8006fcaba33a7d90f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5666575
Reviewed-by: Dominic Battré <[email protected]>
Reviewed-by: Sylvain Defresne <[email protected]>
Code-Coverage: [email protected] <[email protected]>
Auto-Submit: Jan Keitel <[email protected]>
Commit-Queue: Sylvain Defresne <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1320933}
diff --git a/components/prefs/pref_store_observer_mock.h b/components/prefs/pref_store_observer_mock.h
index 5375c9b..630ac70 100644
--- a/components/prefs/pref_store_observer_mock.h
+++ b/components/prefs/pref_store_observer_mock.h
@@ -5,7 +5,7 @@
 #ifndef COMPONENTS_PREFS_PREF_STORE_OBSERVER_MOCK_H_
 #define COMPONENTS_PREFS_PREF_STORE_OBSERVER_MOCK_H_
 
-#include <string>
+#include <string_view>
 #include <vector>
 
 #include "base/compiler_specific.h"
@@ -24,7 +24,7 @@
   void VerifyAndResetChangedKey(const std::string& expected);
 
   // PrefStore::Observer implementation
-  void OnPrefValueChanged(const std::string& key) override;
+  void OnPrefValueChanged(std::string_view key) override;
   void OnInitializationCompleted(bool success) override;
 
   std::vector<std::string> changed_keys;