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

Unified Diff: ui/aura/env.cc

Issue 2759463002: aura-mus: create an interactive ui test for drag and drop. (Closed)
Patch Set: Merge with master Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/env.h ('k') | ui/aura/mus/window_tree_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/env.cc
diff --git a/ui/aura/env.cc b/ui/aura/env.cc
index 1799a59d9eb6718df033557d642377692c35319d..9436b2be50f4a95bc40322d8bef9a0a43b4b202c 100644
--- a/ui/aura/env.cc
+++ b/ui/aura/env.cc
@@ -76,7 +76,7 @@ class Env::ActiveFocusClientWindowObserver : public WindowObserver {
// Env, public:
Env::~Env() {
- if (RunningInsideMus())
+ if (is_os_exchange_data_provider_factory_)
ui::OSExchangeDataProviderFactory::SetFactory(nullptr);
for (EnvObserver& observer : observers_)
@@ -197,7 +197,7 @@ Env::Env(Mode mode)
void Env::Init() {
if (RunningInsideMus()) {
- ui::OSExchangeDataProviderFactory::SetFactory(this);
+ EnableMusOSExchangeDataProvider();
return;
}
@@ -211,6 +211,13 @@ void Env::Init() {
event_source_ = ui::PlatformEventSource::CreateDefault();
}
+void Env::EnableMusOSExchangeDataProvider() {
+ if (!is_os_exchange_data_provider_factory_) {
+ ui::OSExchangeDataProviderFactory::SetFactory(this);
+ is_os_exchange_data_provider_factory_ = true;
+ }
+}
+
void Env::NotifyWindowInitialized(Window* window) {
for (EnvObserver& observer : observers_)
observer.OnWindowInitialized(window);
« no previous file with comments | « ui/aura/env.h ('k') | ui/aura/mus/window_tree_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698