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

Side by Side Diff: chrome/browser/android/compositor/compositor_view.cc

Issue 1268483004: Plumb the anonymize rect color to toolbar_layer from Tab#getThemeColor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tabHasThemeColor
Patch Set: Created 5 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 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/compositor/compositor_view.h" 5 #include "chrome/browser/android/compositor/compositor_view.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include <android/bitmap.h> 9 #include <android/bitmap.h>
10 #include <android/native_window_jni.h> 10 #include <android/native_window_jni.h>
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 // Ensure the toolbar resource is available before making the layer visible. 251 // Ensure the toolbar resource is available before making the layer visible.
252 ui::ResourceManager::Resource* resource = 252 ui::ResourceManager::Resource* resource =
253 compositor_->GetResourceManager().GetResource( 253 compositor_->GetResourceManager().GetResource(
254 ui::ANDROID_RESOURCE_TYPE_DYNAMIC, toolbar_resource_id); 254 ui::ANDROID_RESOURCE_TYPE_DYNAMIC, toolbar_resource_id);
255 if (!resource) 255 if (!resource)
256 visible = false; 256 visible = false;
257 257
258 toolbar_layer_->layer()->SetHideLayerAndSubtree(!visible); 258 toolbar_layer_->layer()->SetHideLayerAndSubtree(!visible);
259 if (visible) { 259 if (visible) {
260 toolbar_layer_->layer()->SetPosition(gfx::PointF(0, top_offset)); 260 toolbar_layer_->layer()->SetPosition(gfx::PointF(0, top_offset));
261 toolbar_layer_->PushResource(resource, false, false, false); 261 toolbar_layer_->PushResource(resource, false, SK_ColorWHITE, false);
262 262
263 // If we're at rest, hide the shadow. The Android view should be drawing. 263 // If we're at rest, hide the shadow. The Android view should be drawing.
264 toolbar_layer_->layer()->SetMasksToBounds(top_offset >= 0.f); 264 toolbar_layer_->layer()->SetMasksToBounds(top_offset >= 0.f);
265 } 265 }
266 } 266 }
267 267
268 void CompositorView::UpdateProgressBar(JNIEnv* env, 268 void CompositorView::UpdateProgressBar(JNIEnv* env,
269 jobject object, 269 jobject object,
270 jint progress_bar_x, 270 jint progress_bar_x,
271 jint progress_bar_y, 271 jint progress_bar_y,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 // through here but through BrowserChildProcessHostDisconnected() instead. 318 // through here but through BrowserChildProcessHostDisconnected() instead.
319 } 319 }
320 320
321 // Register native methods 321 // Register native methods
322 bool RegisterCompositorView(JNIEnv* env) { 322 bool RegisterCompositorView(JNIEnv* env) {
323 return RegisterNativesImpl(env); 323 return RegisterNativesImpl(env);
324 } 324 }
325 325
326 } // namespace android 326 } // namespace android
327 } // namespace chrome 327 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698