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

Side by Side Diff: chrome/browser/ui/views/web_contents_modal_dialog_manager_views.cc

Issue 13932019: Enable rotate style visibility animation for new style web contents modal dialog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use DialogDelegate::UseNewStyle Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/platform_util.h" 7 #include "chrome/browser/platform_util.h"
8 #include "chrome/browser/ui/native_web_contents_modal_dialog_manager.h" 8 #include "chrome/browser/ui/native_web_contents_modal_dialog_manager.h"
9 #include "chrome/browser/ui/views/constrained_window_views.h" 9 #include "chrome/browser/ui/views/constrained_window_views.h"
10 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" 10 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h"
11 #include "ui/views/widget/widget.h" 11 #include "ui/views/widget/widget.h"
12 #include "ui/views/widget/widget_delegate.h" 12 #include "ui/views/widget/widget_delegate.h"
13 #include "ui/views/widget/widget_observer.h" 13 #include "ui/views/widget/widget_observer.h"
14 #include "ui/views/window/dialog_delegate.h"
14 15
15 #if defined(USE_AURA) 16 #if defined(USE_AURA)
16 #include "ui/aura/client/aura_constants.h" 17 #include "ui/aura/client/aura_constants.h"
17 #include "ui/aura/window.h" 18 #include "ui/aura/window.h"
18 #include "ui/views/corewm/visibility_controller.h" 19 #include "ui/views/corewm/visibility_controller.h"
19 #include "ui/views/corewm/window_animations.h" 20 #include "ui/views/corewm/window_animations.h"
20 #include "ui/views/corewm/window_modality_controller.h" 21 #include "ui/views/corewm/window_modality_controller.h"
21 #endif 22 #endif
22 23
23 #if defined(USE_ASH) 24 #if defined(USE_ASH)
(...skipping 25 matching lines...) Expand all
49 virtual void ManageDialog(NativeWebContentsModalDialog dialog) OVERRIDE { 50 virtual void ManageDialog(NativeWebContentsModalDialog dialog) OVERRIDE {
50 views::Widget* widget = GetWidget(dialog); 51 views::Widget* widget = GetWidget(dialog);
51 widget->AddObserver(this); 52 widget->AddObserver(this);
52 observed_widgets_.insert(widget); 53 observed_widgets_.insert(widget);
53 widget->set_movement_disabled(true); 54 widget->set_movement_disabled(true);
54 55
55 #if defined(USE_AURA) 56 #if defined(USE_AURA)
56 // TODO(wittman): remove once the new visual style is complete 57 // TODO(wittman): remove once the new visual style is complete
57 widget->GetNativeWindow()->SetProperty(aura::client::kConstrainedWindowKey, 58 widget->GetNativeWindow()->SetProperty(aura::client::kConstrainedWindowKey,
58 true); 59 true);
60
61 if (views::DialogDelegate::UseNewStyle()) {
62 views::corewm::SetWindowVisibilityAnimationType(
63 widget->GetNativeWindow(),
64 views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_ROTATE);
65 }
59 #endif 66 #endif
60 67
61 #if defined(USE_ASH) 68 #if defined(USE_ASH)
62 gfx::NativeView parent = platform_util::GetParent(widget->GetNativeView()); 69 gfx::NativeView parent = platform_util::GetParent(widget->GetNativeView());
63 views::corewm::SetChildWindowVisibilityChangesAnimated(parent); 70 views::corewm::SetChildWindowVisibilityChangesAnimated(parent);
64 // No animations should get performed on the window since that will re-order 71 // No animations should get performed on the window since that will re-order
65 // the window stack which will then cause many problems. 72 // the window stack which will then cause many problems.
66 if (parent && parent->parent()) { 73 if (parent && parent->parent()) {
67 parent->parent()->SetProperty(aura::client::kAnimationsDisabledKey, true); 74 parent->parent()->SetProperty(aura::client::kAnimationsDisabledKey, true);
68 } 75 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 DISALLOW_COPY_AND_ASSIGN(NativeWebContentsModalDialogManagerViews); 153 DISALLOW_COPY_AND_ASSIGN(NativeWebContentsModalDialogManagerViews);
147 }; 154 };
148 155
149 } // namespace 156 } // namespace
150 157
151 NativeWebContentsModalDialogManager* WebContentsModalDialogManager:: 158 NativeWebContentsModalDialogManager* WebContentsModalDialogManager::
152 CreateNativeManager( 159 CreateNativeManager(
153 NativeWebContentsModalDialogManagerDelegate* native_delegate) { 160 NativeWebContentsModalDialogManagerDelegate* native_delegate) {
154 return new NativeWebContentsModalDialogManagerViews(native_delegate); 161 return new NativeWebContentsModalDialogManagerViews(native_delegate);
155 } 162 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698