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

Side by Side Diff: chrome/browser/android/shortcut_helper.cc

Issue 2184913005: Add calls to the server to request WebAPK updates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/shortcut_helper.h" 5 #include "chrome/browser/android/shortcut_helper.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 ScopedJavaLocalRef<jstring> java_user_title = 158 ScopedJavaLocalRef<jstring> java_user_title =
159 base::android::ConvertUTF16ToJavaString(env, info.user_title); 159 base::android::ConvertUTF16ToJavaString(env, info.user_title);
160 ScopedJavaLocalRef<jobject> java_bitmap; 160 ScopedJavaLocalRef<jobject> java_bitmap;
161 if (icon_bitmap.getSize()) 161 if (icon_bitmap.getSize())
162 java_bitmap = gfx::ConvertToJavaBitmap(&icon_bitmap); 162 java_bitmap = gfx::ConvertToJavaBitmap(&icon_bitmap);
163 163
164 Java_ShortcutHelper_addShortcut(env, java_url.obj(), java_user_title.obj(), 164 Java_ShortcutHelper_addShortcut(env, java_url.obj(), java_user_title.obj(),
165 java_bitmap.obj(), info.source); 165 java_bitmap.obj(), info.source);
166 } 166 }
167 167
168 void ShortcutHelper::OnBuiltWebApk(bool success) { 168 void ShortcutHelper::OnBuiltWebApk(bool success,
169 const std::string& webapk_package) {
169 if (success) { 170 if (success) {
170 LOG(ERROR) << "Sent request to install WebAPK. Seems to have worked."; 171 LOG(ERROR) << "Sent request to install WebAPK. Seems to have worked.";
171 } else { 172 } else {
172 LOG(ERROR) << "WebAPK install failed."; 173 LOG(ERROR) << "WebAPK install failed.";
173 } 174 }
174 // TODO(pkotwicz): Figure out what to do when installing WebAPK fails. 175 // TODO(pkotwicz): Figure out what to do when installing WebAPK fails.
175 // (crbug.com/626950) 176 // (crbug.com/626950)
176 } 177 }
177 178
178 int ShortcutHelper::GetIdealHomescreenIconSizeInDp() { 179 int ShortcutHelper::GetIdealHomescreenIconSizeInDp() {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 DCHECK(jsplash_image_callback); 293 DCHECK(jsplash_image_callback);
293 base::Closure* splash_image_callback = 294 base::Closure* splash_image_callback =
294 reinterpret_cast<base::Closure*>(jsplash_image_callback); 295 reinterpret_cast<base::Closure*>(jsplash_image_callback);
295 splash_image_callback->Run(); 296 splash_image_callback->Run();
296 delete splash_image_callback; 297 delete splash_image_callback;
297 } 298 }
298 299
299 bool ShortcutHelper::RegisterShortcutHelper(JNIEnv* env) { 300 bool ShortcutHelper::RegisterShortcutHelper(JNIEnv* env) {
300 return RegisterNativesImpl(env); 301 return RegisterNativesImpl(env);
301 } 302 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698