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

Side by Side Diff: ui/android/resources/ui_resource_android.cc

Issue 1371523003: Android: Don't destroy LayerTreeHost when Surface goes away (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698