| 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 "athena/extensions/athena_constrained_window_views_client.h" | 5 #include "athena/extensions/athena_constrained_window_views_client.h" |
| 6 | 6 |
| 7 #include "athena/activity/public/activity.h" | 7 #include "athena/activity/public/activity.h" |
| 8 #include "athena/activity/public/activity_manager.h" | 8 #include "athena/activity/public/activity_manager.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| 11 #include "components/constrained_window/constrained_window_views.h" | 11 #include "components/constrained_window/constrained_window_views.h" |
| 12 #include "components/constrained_window/constrained_window_views_client.h" | 12 #include "components/constrained_window/constrained_window_views_client.h" |
| 13 #include "components/web_modal/web_contents_modal_dialog_host.h" | 13 #include "components/web_modal/web_contents_modal_dialog_host.h" |
| 14 #include "extensions/browser/guest_view/guest_view_base.h" | 14 #include "extensions/browser/guest_view/guest_view_base.h" |
| 15 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
| 16 #include "ui/aura/window_observer.h" | 16 #include "ui/aura/window_observer.h" |
| 17 #include "ui/aura/window_property.h" | 17 #include "ui/aura/window_property.h" |
| 18 | 18 |
| 19 DECLARE_WINDOW_PROPERTY_TYPE(web_modal::ModalDialogHost*); | |
| 20 | |
| 21 namespace athena { | 19 namespace athena { |
| 22 namespace { | 20 namespace { |
| 23 | 21 |
| 24 // Provides the host environment for web modal dialogs. See | 22 // Provides the host environment for web modal dialogs. See |
| 25 // web_modal::WebContentsModalDialogHost, and ModalDialogHost for more | 23 // web_modal::WebContentsModalDialogHost, and ModalDialogHost for more |
| 26 // details. | 24 // details. |
| 27 class ModalDialogHostImpl : public web_modal::WebContentsModalDialogHost, | 25 class ModalDialogHostImpl : public web_modal::WebContentsModalDialogHost, |
| 28 public aura::WindowObserver { | 26 public aura::WindowObserver { |
| 29 public: | 27 public: |
| 30 // Returns a modal dialog host for |window|. If it doesn't exist it creates | 28 // Returns a modal dialog host for |window|. If it doesn't exist it creates |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 void InstallConstrainedWindowViewsClient() { | 133 void InstallConstrainedWindowViewsClient() { |
| 136 constrained_window::SetConstrainedWindowViewsClient( | 134 constrained_window::SetConstrainedWindowViewsClient( |
| 137 make_scoped_ptr(new AthenaConstrainedWindowViewsClient)); | 135 make_scoped_ptr(new AthenaConstrainedWindowViewsClient)); |
| 138 } | 136 } |
| 139 | 137 |
| 140 void UninstallConstrainedWindowViewsClient() { | 138 void UninstallConstrainedWindowViewsClient() { |
| 141 constrained_window::SetConstrainedWindowViewsClient(nullptr); | 139 constrained_window::SetConstrainedWindowViewsClient(nullptr); |
| 142 } | 140 } |
| 143 | 141 |
| 144 } // namespace athena | 142 } // namespace athena |
| OLD | NEW |