OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/layer_title_cache.h" | 5 #include "chrome/browser/android/compositor/layer_title_cache.h" |
6 | 6 |
7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 const JavaParamRef<jobject>& obj, | 53 const JavaParamRef<jobject>& obj, |
54 jint tab_id, | 54 jint tab_id, |
55 jint title_resource_id, | 55 jint title_resource_id, |
56 jint favicon_resource_id, | 56 jint favicon_resource_id, |
57 bool is_incognito, | 57 bool is_incognito, |
58 bool is_rtl) { | 58 bool is_rtl) { |
59 DecorationTitle* title_layer = layer_cache_.Lookup(tab_id); | 59 DecorationTitle* title_layer = layer_cache_.Lookup(tab_id); |
60 if (title_layer == NULL) { | 60 if (title_layer == NULL) { |
61 layer_cache_.AddWithID( | 61 layer_cache_.AddWithID( |
62 new DecorationTitle( | 62 new DecorationTitle( |
63 this, resource_manager_, title_resource_id, favicon_resource_id, | 63 resource_manager_, title_resource_id, favicon_resource_id, |
64 spinner_resource_id_, spinner_incognito_resource_id_, fade_width_, | 64 spinner_resource_id_, spinner_incognito_resource_id_, fade_width_, |
65 favicon_start_padding_, favicon_end_padding_, is_incognito, is_rtl), | 65 favicon_start_padding_, favicon_end_padding_, is_incognito, is_rtl), |
66 tab_id); | 66 tab_id); |
67 } else { | 67 } else { |
68 if (title_resource_id != -1 && favicon_resource_id != -1) { | 68 if (title_resource_id != -1 && favicon_resource_id != -1) { |
69 title_layer->Update(title_resource_id, favicon_resource_id, fade_width_, | 69 title_layer->Update(title_resource_id, favicon_resource_id, fade_width_, |
70 favicon_start_padding_, favicon_end_padding_, | 70 favicon_start_padding_, favicon_end_padding_, |
71 is_incognito, is_rtl); | 71 is_incognito, is_rtl); |
72 } else { | 72 } else { |
73 layer_cache_.Remove(tab_id); | 73 layer_cache_.Remove(tab_id); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 jint spinner_resource_id, | 129 jint spinner_resource_id, |
130 jint spinner_incognito_resource_id) { | 130 jint spinner_incognito_resource_id) { |
131 LayerTitleCache* cache = new LayerTitleCache( | 131 LayerTitleCache* cache = new LayerTitleCache( |
132 env, obj, fade_width, favicon_start_padding, favicon_end_padding, | 132 env, obj, fade_width, favicon_start_padding, favicon_end_padding, |
133 spinner_resource_id, spinner_incognito_resource_id); | 133 spinner_resource_id, spinner_incognito_resource_id); |
134 return reinterpret_cast<intptr_t>(cache); | 134 return reinterpret_cast<intptr_t>(cache); |
135 } | 135 } |
136 | 136 |
137 } // namespace android | 137 } // namespace android |
138 } // namespace chrome | 138 } // namespace chrome |
OLD | NEW |