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

Side by Side Diff: ash/wm/gestures/long_press_affordance_handler.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/wm/drag_window_controller.cc ('k') | ash/wm/maximize_mode/workspace_backdrop_delegate.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) 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 "ash/wm/gestures/long_press_affordance_handler.h" 5 #include "ash/wm/gestures/long_press_affordance_handler.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 const SkColor kAffordanceGlowEndColor = SkColorSetARGB(0, 255, 255, 255); 56 const SkColor kAffordanceGlowEndColor = SkColorSetARGB(0, 255, 255, 255);
57 const SkColor kAffordanceArcColor = SkColorSetARGB(80, 0, 0, 0); 57 const SkColor kAffordanceArcColor = SkColorSetARGB(80, 0, 0, 0);
58 const int kAffordanceFrameRateHz = 60; 58 const int kAffordanceFrameRateHz = 60;
59 59
60 views::Widget* CreateAffordanceWidget(aura::Window* root_window) { 60 views::Widget* CreateAffordanceWidget(aura::Window* root_window) {
61 views::Widget* widget = new views::Widget; 61 views::Widget* widget = new views::Widget;
62 views::Widget::InitParams params; 62 views::Widget::InitParams params;
63 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; 63 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS;
64 params.keep_on_top = true; 64 params.keep_on_top = true;
65 params.accept_events = false; 65 params.accept_events = false;
66 params.can_activate = false; 66 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO;
67 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 67 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
68 params.context = root_window; 68 params.context = root_window;
69 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 69 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
70 widget->Init(params); 70 widget->Init(params);
71 widget->SetOpacity(0xFF); 71 widget->SetOpacity(0xFF);
72 GetRootWindowController(root_window)->GetContainer( 72 GetRootWindowController(root_window)->GetContainer(
73 kShellWindowId_OverlayContainer)->AddChild(widget->GetNativeWindow()); 73 kShellWindowId_OverlayContainer)->AddChild(widget->GetNativeWindow());
74 return widget; 74 return widget;
75 } 75 }
76 76
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 break; 358 break;
359 } 359 }
360 } 360 }
361 361
362 void LongPressAffordanceHandler::OnWindowDestroying(aura::Window* window) { 362 void LongPressAffordanceHandler::OnWindowDestroying(aura::Window* window) {
363 DCHECK_EQ(tap_down_target_, window); 363 DCHECK_EQ(tap_down_target_, window);
364 StopAffordance(); 364 StopAffordance();
365 } 365 }
366 366
367 } // namespace ash 367 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/drag_window_controller.cc ('k') | ash/wm/maximize_mode/workspace_backdrop_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698