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

Unified Diff: ios/web_view/internal/translate/web_view_translate_client.h

Issue 2762023003: Enable ARC for //ios/web_view/internal/translate/*.m. (Closed)
Patch Set: Apply review comments. Created 3 years, 9 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
Index: ios/web_view/internal/translate/web_view_translate_client.h
diff --git a/ios/web_view/internal/translate/web_view_translate_client.h b/ios/web_view/internal/translate/web_view_translate_client.h
index ea806960bc5fc5631f7f33cd5911b0a93b53bd5a..9d0816b63be1d96ddcbe9f2ec318606764795855 100644
--- a/ios/web_view/internal/translate/web_view_translate_client.h
+++ b/ios/web_view/internal/translate/web_view_translate_client.h
@@ -8,14 +8,15 @@
#include <memory>
#include <string>
+#import "base/ios/weak_nsobject.h"
#include "components/translate/core/browser/translate_client.h"
#include "components/translate/core/browser/translate_step.h"
#include "components/translate/core/common/translate_errors.h"
#import "components/translate/ios/browser/ios_translate_driver.h"
#include "ios/web/public/web_state/web_state_observer.h"
#import "ios/web/public/web_state/web_state_user_data.h"
+#import "ios/web_view/public/cwv_translate_delegate.h"
-@protocol CWVTranslateDelegate;
class PrefService;
namespace translate {
@@ -38,7 +39,7 @@ class WebViewTranslateClient
// Sets the delegate passed by the embedder.
// |delegate| is assumed to outlive this WebViewTranslateClient.
void set_translate_delegate(id<CWVTranslateDelegate> delegate) {
- delegate_ = delegate;
+ delegate_.reset(delegate);
}
private:
@@ -72,7 +73,7 @@ class WebViewTranslateClient
translate::IOSTranslateDriver translate_driver_;
// Delegate provided by the embedder.
- id<CWVTranslateDelegate> delegate_; // Weak.
+ base::WeakNSProtocol<id<CWVTranslateDelegate>> delegate_;
DISALLOW_COPY_AND_ASSIGN(WebViewTranslateClient);
};

Powered by Google App Engine
This is Rietveld 408576698