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

Side by Side Diff: content/browser/web_contents/web_contents_android.cc

Issue 789703004: Reflect the status of a request for accessing a blacklisted url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 "content/browser/web_contents/web_contents_android.h" 5 #include "content/browser/web_contents/web_contents_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 void WebContentsAndroid::InsertCSS( 116 void WebContentsAndroid::InsertCSS(
117 JNIEnv* env, jobject jobj, jstring jcss) { 117 JNIEnv* env, jobject jobj, jstring jcss) {
118 web_contents_->InsertCSS(base::android::ConvertJavaStringToUTF8(env, jcss)); 118 web_contents_->InsertCSS(base::android::ConvertJavaStringToUTF8(env, jcss));
119 } 119 }
120 120
121 RenderWidgetHostViewAndroid* 121 RenderWidgetHostViewAndroid*
122 WebContentsAndroid::GetRenderWidgetHostViewAndroid() { 122 WebContentsAndroid::GetRenderWidgetHostViewAndroid() {
123 RenderWidgetHostView* rwhv = NULL; 123 RenderWidgetHostView* rwhv = NULL;
124 rwhv = web_contents_->GetRenderWidgetHostView(); 124 rwhv = web_contents_->GetRenderWidgetHostView();
125 if (web_contents_->ShowingInterstitialPage()) { 125 if (web_contents_->ShowingInterstitialPage()) {
126 rwhv = static_cast<InterstitialPageImpl*>( 126 rwhv = web_contents_->GetInterstitialPage()
127 web_contents_->GetInterstitialPage())-> 127 ->GetMainFrame()
128 GetRenderViewHost()->GetView(); 128 ->GetRenderViewHost()
129 ->GetView();
129 } 130 }
130 return static_cast<RenderWidgetHostViewAndroid*>(rwhv); 131 return static_cast<RenderWidgetHostViewAndroid*>(rwhv);
131 } 132 }
132 133
133 jint WebContentsAndroid::GetBackgroundColor(JNIEnv* env, jobject obj) { 134 jint WebContentsAndroid::GetBackgroundColor(JNIEnv* env, jobject obj) {
134 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); 135 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid();
135 if (!rwhva) 136 if (!rwhva)
136 return SK_ColorWHITE; 137 return SK_ColorWHITE;
137 return rwhva->GetCachedBackgroundColor(); 138 return rwhva->GetCachedBackgroundColor();
138 } 139 }
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 ScopedJavaGlobalRef<jobject> j_callback; 445 ScopedJavaGlobalRef<jobject> j_callback;
445 j_callback.Reset(env, callback); 446 j_callback.Reset(env, callback);
446 content::RenderFrameHost::JavaScriptResultCallback js_callback = 447 content::RenderFrameHost::JavaScriptResultCallback js_callback =
447 base::Bind(&JavaScriptResultCallback, j_callback); 448 base::Bind(&JavaScriptResultCallback, j_callback);
448 449
449 web_contents_->GetMainFrame()->ExecuteJavaScript( 450 web_contents_->GetMainFrame()->ExecuteJavaScript(
450 ConvertJavaStringToUTF16(env, script), js_callback); 451 ConvertJavaStringToUTF16(env, script), js_callback);
451 } 452 }
452 453
453 } // namespace content 454 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698