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

Side by Side Diff: chrome/browser/android/ntp/ntp_snippets_bridge.cc

Issue 2167063003: Rename discard to dismiss for NTP snippets and content suggestions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bridgeumbiegen
Patch Set: Fix unit test Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/snippets_internals.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/android/ntp/ntp_snippets_bridge.h" 5 #include "chrome/browser/android/ntp/ntp_snippets_bridge.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 8
9 #include "base/android/callback_android.h" 9 #include "base/android/callback_android.h"
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 base::android::ScopedJavaGlobalRef<jobject> callback(j_callback); 99 base::android::ScopedJavaGlobalRef<jobject> callback(j_callback);
100 content_suggestions_service_->FetchSuggestionImage( 100 content_suggestions_service_->FetchSuggestionImage(
101 ConvertJavaStringToUTF8(env, snippet_id), 101 ConvertJavaStringToUTF8(env, snippet_id),
102 base::Bind(&NTPSnippetsBridge::OnImageFetched, 102 base::Bind(&NTPSnippetsBridge::OnImageFetched,
103 weak_ptr_factory_.GetWeakPtr(), callback)); 103 weak_ptr_factory_.GetWeakPtr(), callback));
104 } 104 }
105 105
106 void NTPSnippetsBridge::DiscardSnippet(JNIEnv* env, 106 void NTPSnippetsBridge::DiscardSnippet(JNIEnv* env,
107 const JavaParamRef<jobject>& obj, 107 const JavaParamRef<jobject>& obj,
108 const JavaParamRef<jstring>& id) { 108 const JavaParamRef<jstring>& id) {
109 content_suggestions_service_->DiscardSuggestion( 109 content_suggestions_service_->DismissSuggestion(
110 ConvertJavaStringToUTF8(env, id)); 110 ConvertJavaStringToUTF8(env, id));
111 } 111 }
112 112
113 void NTPSnippetsBridge::SnippetVisited(JNIEnv* env, 113 void NTPSnippetsBridge::SnippetVisited(JNIEnv* env,
114 const JavaParamRef<jobject>& obj, 114 const JavaParamRef<jobject>& obj,
115 const JavaParamRef<jobject>& jcallback, 115 const JavaParamRef<jobject>& jcallback,
116 const JavaParamRef<jstring>& jurl) { 116 const JavaParamRef<jstring>& jurl) {
117 base::android::ScopedJavaGlobalRef<jobject> callback(jcallback); 117 base::android::ScopedJavaGlobalRef<jobject> callback(jcallback);
118 118
119 history_service_->QueryURL( 119 history_service_->QueryURL(
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 if (!image.IsEmpty()) 197 if (!image.IsEmpty())
198 j_bitmap = gfx::ConvertToJavaBitmap(image.ToSkBitmap()); 198 j_bitmap = gfx::ConvertToJavaBitmap(image.ToSkBitmap());
199 199
200 base::android::RunCallbackAndroid(callback, j_bitmap); 200 base::android::RunCallbackAndroid(callback, j_bitmap);
201 } 201 }
202 202
203 // static 203 // static
204 bool NTPSnippetsBridge::Register(JNIEnv* env) { 204 bool NTPSnippetsBridge::Register(JNIEnv* env) {
205 return RegisterNativesImpl(env); 205 return RegisterNativesImpl(env);
206 } 206 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/snippets_internals.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698