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 "ui/android/resources/ui_resource_android.h" | 5 #include "ui/android/resources/ui_resource_android.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/android/resources/ui_resource_provider.h" | 8 #include "ui/android/resources/ui_resource_provider.h" |
9 | 9 |
10 namespace ui { | 10 namespace ui { |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 cc::UIResourceId UIResourceAndroid::id() { | 32 cc::UIResourceId UIResourceAndroid::id() { |
33 if (id_) | 33 if (id_) |
34 return id_; | 34 return id_; |
35 if (!provider_ || bitmap_.empty()) | 35 if (!provider_ || bitmap_.empty()) |
36 return 0; | 36 return 0; |
37 id_ = provider_->CreateUIResource(this); | 37 id_ = provider_->CreateUIResource(this); |
38 return id_; | 38 return id_; |
39 } | 39 } |
40 | 40 |
41 void UIResourceAndroid::UIResourceIsInvalid() { | |
42 id_ = 0; | |
43 } | |
44 | |
45 UIResourceAndroid::UIResourceAndroid(ui::UIResourceProvider* provider, | 41 UIResourceAndroid::UIResourceAndroid(ui::UIResourceProvider* provider, |
46 const SkBitmap& skbitmap) | 42 const SkBitmap& skbitmap) |
47 : provider_(provider), bitmap_(skbitmap), id_(0) { | 43 : provider_(provider), bitmap_(skbitmap), id_(0) { |
48 } | 44 } |
49 | 45 |
50 } // namespace ui | 46 } // namespace ui |
OLD | NEW |