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

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 1411063007: Add mojo::StrongBindingSet and use it in GeolocationServiceContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | content/browser/devtools/protocol/emulation_handler.cc » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/android/content_view_core_impl.h" 5 #include "content/browser/android/content_view_core_impl.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 } 357 }
358 358
359 jint ContentViewCoreImpl::GetBackgroundColor(JNIEnv* env, jobject obj) { 359 jint ContentViewCoreImpl::GetBackgroundColor(JNIEnv* env, jobject obj) {
360 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); 360 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid();
361 if (!rwhva) 361 if (!rwhva)
362 return SK_ColorWHITE; 362 return SK_ColorWHITE;
363 return rwhva->GetCachedBackgroundColor(); 363 return rwhva->GetCachedBackgroundColor();
364 } 364 }
365 365
366 void ContentViewCoreImpl::PauseOrResumeGeolocation(bool should_pause) { 366 void ContentViewCoreImpl::PauseOrResumeGeolocation(bool should_pause) {
367 if (should_pause) 367 if (should_pause) {
368 web_contents_->GetGeolocationServiceContext()->PauseUpdates(); 368 GeolocationServiceContext::GetOrCreateForWebContents(web_contents_)
369 else 369 ->PauseUpdates();
370 web_contents_->GetGeolocationServiceContext()->ResumeUpdates(); 370 } else {
371 GeolocationServiceContext* geolocation_service_context =
372 GeolocationServiceContext::FromWebContents(web_contents_);
373 if (geolocation_service_context)
374 geolocation_service_context->ResumeUpdates();
375 }
371 } 376 }
372 377
373 // All positions and sizes are in CSS pixels. 378 // All positions and sizes are in CSS pixels.
374 // Note that viewport_width/height is a best effort based. 379 // Note that viewport_width/height is a best effort based.
375 // ContentViewCore has the actual information about the physical viewport size. 380 // ContentViewCore has the actual information about the physical viewport size.
376 void ContentViewCoreImpl::UpdateFrameInfo( 381 void ContentViewCoreImpl::UpdateFrameInfo(
377 const gfx::Vector2dF& scroll_offset, 382 const gfx::Vector2dF& scroll_offset,
378 float page_scale_factor, 383 float page_scale_factor,
379 const gfx::Vector2dF& page_scale_factor_limits, 384 const gfx::Vector2dF& page_scale_factor_limits,
380 const gfx::SizeF& content_size, 385 const gfx::SizeF& content_size,
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 return ScopedJavaLocalRef<jobject>(); 1459 return ScopedJavaLocalRef<jobject>();
1455 1460
1456 return view->GetJavaObject(); 1461 return view->GetJavaObject();
1457 } 1462 }
1458 1463
1459 bool RegisterContentViewCore(JNIEnv* env) { 1464 bool RegisterContentViewCore(JNIEnv* env) {
1460 return RegisterNativesImpl(env); 1465 return RegisterNativesImpl(env);
1461 } 1466 }
1462 1467
1463 } // namespace content 1468 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/devtools/protocol/emulation_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698