| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "gfx/gtk_native_view_id_manager.h" | 5 #include "gfx/gtk_native_view_id_manager.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
| 9 #include "gfx/rect.h" | 9 #include "gfx/rect.h" |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 // ----------------------------------------------------------------------------- | 32 // ----------------------------------------------------------------------------- |
| 33 | 33 |
| 34 | 34 |
| 35 // ----------------------------------------------------------------------------- | 35 // ----------------------------------------------------------------------------- |
| 36 // Public functions... | 36 // Public functions... |
| 37 | 37 |
| 38 GtkNativeViewManager::GtkNativeViewManager() { | 38 GtkNativeViewManager::GtkNativeViewManager() { |
| 39 } | 39 } |
| 40 | 40 |
| 41 GtkNativeViewManager::~GtkNativeViewManager() { |
| 42 } |
| 43 |
| 41 gfx::NativeViewId GtkNativeViewManager::GetIdForWidget(gfx::NativeView widget) { | 44 gfx::NativeViewId GtkNativeViewManager::GetIdForWidget(gfx::NativeView widget) { |
| 42 // This is just for unit tests: | 45 // This is just for unit tests: |
| 43 if (!widget) | 46 if (!widget) |
| 44 return 0; | 47 return 0; |
| 45 | 48 |
| 46 AutoLock locked(lock_); | 49 AutoLock locked(lock_); |
| 47 | 50 |
| 48 std::map<gfx::NativeView, gfx::NativeViewId>::const_iterator i = | 51 std::map<gfx::NativeView, gfx::NativeViewId>::const_iterator i = |
| 49 native_view_to_id_.find(widget); | 52 native_view_to_id_.find(widget); |
| 50 | 53 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 140 |
| 138 std::map<gfx::NativeViewId, NativeViewInfo>::iterator j = | 141 std::map<gfx::NativeViewId, NativeViewInfo>::iterator j = |
| 139 id_to_info_.find(i->second); | 142 id_to_info_.find(i->second); |
| 140 CHECK(j != id_to_info_.end()); | 143 CHECK(j != id_to_info_.end()); |
| 141 | 144 |
| 142 native_view_to_id_.erase(i); | 145 native_view_to_id_.erase(i); |
| 143 id_to_info_.erase(j); | 146 id_to_info_.erase(j); |
| 144 } | 147 } |
| 145 | 148 |
| 146 // ----------------------------------------------------------------------------- | 149 // ----------------------------------------------------------------------------- |
| OLD | NEW |