OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/api/tab_capture/tab_capture_registry.h" | 5 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 } | 60 } |
61 | 61 |
62 protected: | 62 protected: |
63 void ScheduleFindNewParentIfDetached(aura::Window* root_window) { | 63 void ScheduleFindNewParentIfDetached(aura::Window* root_window) { |
64 if (root_window) | 64 if (root_window) |
65 return; | 65 return; |
66 // Post a task to return to the event loop before finding a new parent, to | 66 // Post a task to return to the event loop before finding a new parent, to |
67 // avoid clashing with the currently-in-progress window tree hierarchy | 67 // avoid clashing with the currently-in-progress window tree hierarchy |
68 // changes. | 68 // changes. |
69 base::ThreadTaskRunnerHandle::Get()->PostTask( | 69 base::ThreadTaskRunnerHandle::Get()->PostTask( |
70 FROM_HERE, | 70 FROM_HERE, base::BindOnce(&WindowAdoptionAgent::FindNewParent, |
71 base::Bind(&WindowAdoptionAgent::FindNewParent, | 71 weak_ptr_factory_.GetWeakPtr())); |
72 weak_ptr_factory_.GetWeakPtr())); | |
73 } | 72 } |
74 | 73 |
75 // aura::WindowObserver: | 74 // aura::WindowObserver: |
76 void OnWindowDestroyed(aura::Window* window) final { | 75 void OnWindowDestroyed(aura::Window* window) final { |
77 DCHECK_EQ(content_window_, window); | 76 DCHECK_EQ(content_window_, window); |
78 content_window_ = nullptr; | 77 content_window_ = nullptr; |
79 } | 78 } |
80 | 79 |
81 void OnWindowRemovingFromRootWindow(aura::Window* window, | 80 void OnWindowRemovingFromRootWindow(aura::Window* window, |
82 aura::Window* new_root) final { | 81 aura::Window* new_root) final { |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 it != requests_.end(); ++it) { | 463 it != requests_.end(); ++it) { |
465 if (it->get() == request) { | 464 if (it->get() == request) { |
466 requests_.erase(it); | 465 requests_.erase(it); |
467 return; | 466 return; |
468 } | 467 } |
469 } | 468 } |
470 NOTREACHED(); | 469 NOTREACHED(); |
471 } | 470 } |
472 | 471 |
473 } // namespace extensions | 472 } // namespace extensions |
OLD | NEW |