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

Side by Side Diff: chrome/browser/android/offline_pages/offline_page_bridge.cc

Issue 2503853004: Support getting offline pages also by original URL (Closed)
Patch Set: Make NTP redirect work per comment Created 4 years, 1 month 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/android/offline_pages/offline_page_request_job.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/offline_pages/offline_page_bridge.h" 5 #include "chrome/browser/android/offline_pages/offline_page_bridge.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 JNIEnv* env, 401 JNIEnv* env,
402 const JavaParamRef<jobject>& obj, 402 const JavaParamRef<jobject>& obj,
403 const JavaParamRef<jstring>& j_online_url, 403 const JavaParamRef<jstring>& j_online_url,
404 int tab_id, 404 int tab_id,
405 const JavaParamRef<jobject>& j_callback_obj) { 405 const JavaParamRef<jobject>& j_callback_obj) {
406 DCHECK(j_callback_obj); 406 DCHECK(j_callback_obj);
407 407
408 ScopedJavaGlobalRef<jobject> j_callback_ref; 408 ScopedJavaGlobalRef<jobject> j_callback_ref;
409 j_callback_ref.Reset(env, j_callback_obj); 409 j_callback_ref.Reset(env, j_callback_obj);
410 410
411 OfflinePageUtils::SelectPageForOnlineURL( 411 OfflinePageUtils::SelectPageForURL(
412 browser_context_, 412 browser_context_,
413 GURL(ConvertJavaStringToUTF8(env, j_online_url)), 413 GURL(ConvertJavaStringToUTF8(env, j_online_url)),
414 OfflinePageModel::URLSearchMode::SEARCH_BY_ALL_URLS,
414 tab_id, 415 tab_id,
415 base::Bind(&SingleOfflinePageItemCallback, j_callback_ref)); 416 base::Bind(&SingleOfflinePageItemCallback, j_callback_ref));
416 } 417 }
417 418
418 void OfflinePageBridge::SavePage( 419 void OfflinePageBridge::SavePage(
419 JNIEnv* env, 420 JNIEnv* env,
420 const JavaParamRef<jobject>& obj, 421 const JavaParamRef<jobject>& obj,
421 const JavaParamRef<jobject>& j_callback_obj, 422 const JavaParamRef<jobject>& j_callback_obj,
422 const JavaParamRef<jobject>& j_web_contents, 423 const JavaParamRef<jobject>& j_web_contents,
423 const JavaParamRef<jstring>& j_namespace, 424 const JavaParamRef<jstring>& j_namespace,
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 env, ConvertUTF8ToJavaString(env, client_id.name_space), 568 env, ConvertUTF8ToJavaString(env, client_id.name_space),
568 ConvertUTF8ToJavaString(env, client_id.id)); 569 ConvertUTF8ToJavaString(env, client_id.id));
569 } 570 }
570 571
571 bool RegisterOfflinePageBridge(JNIEnv* env) { 572 bool RegisterOfflinePageBridge(JNIEnv* env) {
572 return RegisterNativesImpl(env); 573 return RegisterNativesImpl(env);
573 } 574 }
574 575
575 } // namespace android 576 } // namespace android
576 } // namespace offline_pages 577 } // namespace offline_pages
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/offline_page_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698