Chromium Code Reviews| 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 <set> | 5 #include <set> |
| 6 | 6 |
| 7 #include "base/command_line.h" | |
| 7 #include "chrome/browser/platform_util.h" | 8 #include "chrome/browser/platform_util.h" |
| 8 #include "chrome/browser/ui/native_web_contents_modal_dialog_manager.h" | 9 #include "chrome/browser/ui/native_web_contents_modal_dialog_manager.h" |
| 9 #include "chrome/browser/ui/views/constrained_window_views.h" | 10 #include "chrome/browser/ui/views/constrained_window_views.h" |
| 10 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" | 11 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" |
| 12 #include "ui/base/ui_base_switches.h" | |
| 11 #include "ui/views/widget/widget.h" | 13 #include "ui/views/widget/widget.h" |
| 12 #include "ui/views/widget/widget_delegate.h" | 14 #include "ui/views/widget/widget_delegate.h" |
| 13 #include "ui/views/widget/widget_observer.h" | 15 #include "ui/views/widget/widget_observer.h" |
| 14 | 16 |
| 15 #if defined(USE_AURA) | 17 #if defined(USE_AURA) |
| 16 #include "ui/aura/client/aura_constants.h" | 18 #include "ui/aura/client/aura_constants.h" |
| 17 #include "ui/aura/window.h" | 19 #include "ui/aura/window.h" |
| 18 #include "ui/views/corewm/visibility_controller.h" | 20 #include "ui/views/corewm/visibility_controller.h" |
| 19 #include "ui/views/corewm/window_animations.h" | 21 #include "ui/views/corewm/window_animations.h" |
| 20 #include "ui/views/corewm/window_modality_controller.h" | 22 #include "ui/views/corewm/window_modality_controller.h" |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 49 virtual void ManageDialog(NativeWebContentsModalDialog dialog) OVERRIDE { | 51 virtual void ManageDialog(NativeWebContentsModalDialog dialog) OVERRIDE { |
| 50 views::Widget* widget = GetWidget(dialog); | 52 views::Widget* widget = GetWidget(dialog); |
| 51 widget->AddObserver(this); | 53 widget->AddObserver(this); |
| 52 observed_widgets_.insert(widget); | 54 observed_widgets_.insert(widget); |
| 53 widget->set_movement_disabled(true); | 55 widget->set_movement_disabled(true); |
| 54 | 56 |
| 55 #if defined(USE_AURA) | 57 #if defined(USE_AURA) |
| 56 // TODO(wittman): remove once the new visual style is complete | 58 // TODO(wittman): remove once the new visual style is complete |
| 57 widget->GetNativeWindow()->SetProperty(aura::client::kConstrainedWindowKey, | 59 widget->GetNativeWindow()->SetProperty(aura::client::kConstrainedWindowKey, |
| 58 true); | 60 true); |
| 61 | |
| 62 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
|
msw
2013/04/12 19:22:07
nit: use DialogDelegate::UseNewStyle. (just to mak
Mike Wittman
2013/04/12 20:42:15
Done.
| |
| 63 switches::kEnableNewDialogStyle)) { | |
| 64 views::corewm::SetWindowVisibilityAnimationType( | |
| 65 widget->GetNativeWindow(), | |
| 66 views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_ROTATE); | |
| 67 } | |
| 59 #endif | 68 #endif |
| 60 | 69 |
| 61 #if defined(USE_ASH) | 70 #if defined(USE_ASH) |
| 62 gfx::NativeView parent = platform_util::GetParent(widget->GetNativeView()); | 71 gfx::NativeView parent = platform_util::GetParent(widget->GetNativeView()); |
| 63 views::corewm::SetChildWindowVisibilityChangesAnimated(parent); | 72 views::corewm::SetChildWindowVisibilityChangesAnimated(parent); |
| 64 // No animations should get performed on the window since that will re-order | 73 // No animations should get performed on the window since that will re-order |
| 65 // the window stack which will then cause many problems. | 74 // the window stack which will then cause many problems. |
| 66 if (parent && parent->parent()) { | 75 if (parent && parent->parent()) { |
| 67 parent->parent()->SetProperty(aura::client::kAnimationsDisabledKey, true); | 76 parent->parent()->SetProperty(aura::client::kAnimationsDisabledKey, true); |
| 68 } | 77 } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 DISALLOW_COPY_AND_ASSIGN(NativeWebContentsModalDialogManagerViews); | 155 DISALLOW_COPY_AND_ASSIGN(NativeWebContentsModalDialogManagerViews); |
| 147 }; | 156 }; |
| 148 | 157 |
| 149 } // namespace | 158 } // namespace |
| 150 | 159 |
| 151 NativeWebContentsModalDialogManager* WebContentsModalDialogManager:: | 160 NativeWebContentsModalDialogManager* WebContentsModalDialogManager:: |
| 152 CreateNativeManager( | 161 CreateNativeManager( |
| 153 NativeWebContentsModalDialogManagerDelegate* native_delegate) { | 162 NativeWebContentsModalDialogManagerDelegate* native_delegate) { |
| 154 return new NativeWebContentsModalDialogManagerViews(native_delegate); | 163 return new NativeWebContentsModalDialogManagerViews(native_delegate); |
| 155 } | 164 } |
| OLD | NEW |