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

Side by Side Diff: ash/sticky_keys/sticky_keys_overlay.cc

Issue 286733002: [Refactor] Consolidate the logic for whether a widget can be activated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « ash/shelf/shelf_widget.cc ('k') | ash/tooltips/tooltip_controller_unittest.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 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 "ash/sticky_keys/sticky_keys_overlay.h" 5 #include "ash/sticky_keys/sticky_keys_overlay.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/sticky_keys/sticky_keys_controller.h" 9 #include "ash/sticky_keys/sticky_keys_controller.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 // StickyKeysOverlay 220 // StickyKeysOverlay
221 StickyKeysOverlay::StickyKeysOverlay() 221 StickyKeysOverlay::StickyKeysOverlay()
222 : is_visible_(false), 222 : is_visible_(false),
223 overlay_view_(new StickyKeysOverlayView), 223 overlay_view_(new StickyKeysOverlayView),
224 widget_size_(overlay_view_->GetPreferredSize()) { 224 widget_size_(overlay_view_->GetPreferredSize()) {
225 views::Widget::InitParams params; 225 views::Widget::InitParams params;
226 params.type = views::Widget::InitParams::TYPE_POPUP; 226 params.type = views::Widget::InitParams::TYPE_POPUP;
227 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 227 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
228 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 228 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
229 params.accept_events = false; 229 params.accept_events = false;
230 params.can_activate = false;
231 params.keep_on_top = true; 230 params.keep_on_top = true;
232 params.remove_standard_frame = true; 231 params.remove_standard_frame = true;
233 params.delegate = overlay_view_; 232 params.delegate = overlay_view_;
234 params.bounds = CalculateOverlayBounds(); 233 params.bounds = CalculateOverlayBounds();
235 params.parent = Shell::GetContainer(Shell::GetTargetRootWindow(), 234 params.parent = Shell::GetContainer(Shell::GetTargetRootWindow(),
236 kShellWindowId_OverlayContainer); 235 kShellWindowId_OverlayContainer);
237 overlay_widget_.reset(new views::Widget); 236 overlay_widget_.reset(new views::Widget);
238 overlay_widget_->Init(params); 237 overlay_widget_->Init(params);
239 overlay_widget_->SetVisibilityChangedAnimationsEnabled(false); 238 overlay_widget_->SetVisibilityChangedAnimationsEnabled(false);
240 overlay_widget_->SetContentsView(overlay_view_); 239 overlay_widget_->SetContentsView(overlay_view_);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 ui::LayerAnimator* animator = overlay_widget_->GetLayer()->GetAnimator(); 312 ui::LayerAnimator* animator = overlay_widget_->GetLayer()->GetAnimator();
314 if (animator) 313 if (animator)
315 animator->RemoveObserver(this); 314 animator->RemoveObserver(this);
316 } 315 }
317 316
318 void StickyKeysOverlay::OnLayerAnimationScheduled( 317 void StickyKeysOverlay::OnLayerAnimationScheduled(
319 ui::LayerAnimationSequence* sequence) { 318 ui::LayerAnimationSequence* sequence) {
320 } 319 }
321 320
322 } // namespace ash 321 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_widget.cc ('k') | ash/tooltips/tooltip_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698