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

Side by Side Diff: ui/aura_shell/modal_container_layout_manager.cc

Issue 8585007: Added hotkey support to 8508009 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for try bots Created 9 years 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 | « ui/aura_shell/launcher/launcher.cc ('k') | ui/aura_shell/shell_accelerator_controller.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/aura_shell/modal_container_layout_manager.h" 5 #include "ui/aura_shell/modal_container_layout_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "ui/aura/client/aura_constants.h" 8 #include "ui/aura/client/aura_constants.h"
9 #include "ui/aura/desktop.h" 9 #include "ui/aura/desktop.h"
10 #include "ui/aura/event.h" 10 #include "ui/aura/event.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 void ModalContainerLayoutManager::CreateModalScreen() { 154 void ModalContainerLayoutManager::CreateModalScreen() {
155 if (modal_screen_) 155 if (modal_screen_)
156 return; 156 return;
157 modal_screen_ = new views::Widget; 157 modal_screen_ = new views::Widget;
158 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); 158 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL);
159 params.parent = container_; 159 params.parent = container_;
160 params.bounds = gfx::Rect(0, 0, container_->bounds().width(), 160 params.bounds = gfx::Rect(0, 0, container_->bounds().width(),
161 container_->bounds().height()); 161 container_->bounds().height());
162 modal_screen_->Init(params); 162 modal_screen_->Init(params);
163 modal_screen_->GetNativeView()->set_name( 163 modal_screen_->GetNativeView()->SetName(
164 "ModalContainerLayoutManager.ModalScreen"); 164 "ModalContainerLayoutManager.ModalScreen");
165 modal_screen_->SetContentsView(new ScreenView); 165 modal_screen_->SetContentsView(new ScreenView);
166 modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f); 166 modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f);
167 modal_screen_->GetNativeView()->layer()->GetAnimator()->AddObserver(this); 167 modal_screen_->GetNativeView()->layer()->GetAnimator()->AddObserver(this);
168 168
169 Shell::GetInstance()->AddDesktopEventFilter(modality_filter_.get()); 169 Shell::GetInstance()->AddDesktopEventFilter(modality_filter_.get());
170 170
171 ui::LayerAnimator::ScopedSettings settings( 171 ui::LayerAnimator::ScopedSettings settings(
172 modal_screen_->GetNativeView()->layer()->GetAnimator()); 172 modal_screen_->GetNativeView()->layer()->GetAnimator());
173 modal_screen_->Show(); 173 modal_screen_->Show();
174 modal_screen_->GetNativeView()->layer()->SetOpacity(0.5f); 174 modal_screen_->GetNativeView()->layer()->SetOpacity(0.5f);
175 container_->StackChildAtTop(modal_screen_->GetNativeView()); 175 container_->StackChildAtTop(modal_screen_->GetNativeView());
176 } 176 }
177 177
178 void ModalContainerLayoutManager::DestroyModalScreen() { 178 void ModalContainerLayoutManager::DestroyModalScreen() {
179 modal_screen_->GetNativeView()->layer()->GetAnimator()->RemoveObserver(this); 179 modal_screen_->GetNativeView()->layer()->GetAnimator()->RemoveObserver(this);
180 modal_screen_->Close(); 180 modal_screen_->Close();
181 modal_screen_ = NULL; 181 modal_screen_ = NULL;
182 } 182 }
183 183
184 void ModalContainerLayoutManager::HideModalScreen() { 184 void ModalContainerLayoutManager::HideModalScreen() {
185 Shell::GetInstance()->RemoveDesktopEventFilter(modality_filter_.get()); 185 Shell::GetInstance()->RemoveDesktopEventFilter(modality_filter_.get());
186 ui::LayerAnimator::ScopedSettings settings( 186 ui::LayerAnimator::ScopedSettings settings(
187 modal_screen_->GetNativeView()->layer()->GetAnimator()); 187 modal_screen_->GetNativeView()->layer()->GetAnimator());
188 modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f); 188 modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f);
189 } 189 }
190 190
191 } // namespace internal 191 } // namespace internal
192 } // namespace aura_shell 192 } // namespace aura_shell
OLDNEW
« no previous file with comments | « ui/aura_shell/launcher/launcher.cc ('k') | ui/aura_shell/shell_accelerator_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698