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

Side by Side Diff: ash/wm/dock/docked_window_layout_manager.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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/dock/docked_window_layout_manager.h" 5 #include "ash/wm/dock/docked_window_layout_manager.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/screen_util.h" 8 #include "ash/screen_util.h"
9 #include "ash/shelf/shelf.h" 9 #include "ash/shelf/shelf.h"
10 #include "ash/shelf/shelf_constants.h" 10 #include "ash/shelf/shelf_constants.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 virtual void UpdateBackground(int alpha) OVERRIDE { 131 virtual void UpdateBackground(int alpha) OVERRIDE {
132 alpha_ = alpha; 132 alpha_ = alpha;
133 SchedulePaintInRect(gfx::Rect(GetWindowBoundsInScreen().size())); 133 SchedulePaintInRect(gfx::Rect(GetWindowBoundsInScreen().size()));
134 } 134 }
135 135
136 private: 136 private:
137 void InitWidget(aura::Window* parent) { 137 void InitWidget(aura::Window* parent) {
138 views::Widget::InitParams params; 138 views::Widget::InitParams params;
139 params.type = views::Widget::InitParams::TYPE_POPUP; 139 params.type = views::Widget::InitParams::TYPE_POPUP;
140 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 140 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
141 params.can_activate = false;
142 params.keep_on_top = false; 141 params.keep_on_top = false;
143 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 142 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
144 params.parent = parent; 143 params.parent = parent;
145 params.accept_events = false; 144 params.accept_events = false;
146 set_focus_on_creation(false); 145 set_focus_on_creation(false);
147 Init(params); 146 Init(params);
148 SetVisibilityChangedAnimationsEnabled(false); 147 SetVisibilityChangedAnimationsEnabled(false);
149 GetNativeWindow()->SetProperty(kStayInSameRootWindowKey, true); 148 GetNativeWindow()->SetProperty(kStayInSameRootWindowKey, true);
150 opaque_background_.SetColor(SK_ColorBLACK); 149 opaque_background_.SetColor(SK_ColorBLACK);
151 opaque_background_.SetBounds(gfx::Rect(GetWindowBoundsInScreen().size())); 150 opaque_background_.SetBounds(gfx::Rect(GetWindowBoundsInScreen().size()));
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 1321
1323 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( 1322 void DockedWindowLayoutManager::OnKeyboardBoundsChanging(
1324 const gfx::Rect& keyboard_bounds) { 1323 const gfx::Rect& keyboard_bounds) {
1325 // This bounds change will have caused a change to the Shelf which does not 1324 // This bounds change will have caused a change to the Shelf which does not
1326 // propagate automatically to this class, so manually recalculate bounds. 1325 // propagate automatically to this class, so manually recalculate bounds.
1327 Relayout(); 1326 Relayout();
1328 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); 1327 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING);
1329 } 1328 }
1330 1329
1331 } // namespace ash 1330 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698