| OLD | NEW |
| 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/panels/panel_layout_manager.h" | 5 #include "ash/wm/panels/panel_layout_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 background_->set_alignment(alignment); | 222 background_->set_alignment(alignment); |
| 223 SchedulePaintInRect(gfx::Rect(gfx::Point(), callout_bounds.size())); | 223 SchedulePaintInRect(gfx::Rect(gfx::Point(), callout_bounds.size())); |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 | 226 |
| 227 private: | 227 private: |
| 228 void InitWidget(aura::Window* parent) { | 228 void InitWidget(aura::Window* parent) { |
| 229 views::Widget::InitParams params; | 229 views::Widget::InitParams params; |
| 230 params.type = views::Widget::InitParams::TYPE_POPUP; | 230 params.type = views::Widget::InitParams::TYPE_POPUP; |
| 231 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 231 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 232 params.can_activate = false; | |
| 233 params.keep_on_top = true; | 232 params.keep_on_top = true; |
| 234 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 233 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 235 params.parent = parent; | 234 params.parent = parent; |
| 236 params.bounds = ScreenUtil::ConvertRectToScreen(parent, gfx::Rect()); | 235 params.bounds = ScreenUtil::ConvertRectToScreen(parent, gfx::Rect()); |
| 237 params.bounds.set_width(kArrowWidth); | 236 params.bounds.set_width(kArrowWidth); |
| 238 params.bounds.set_height(kArrowHeight); | 237 params.bounds.set_height(kArrowHeight); |
| 239 params.accept_events = false; | 238 params.accept_events = false; |
| 240 // Why do we need this and can_activate = false? | |
| 241 set_focus_on_creation(false); | 239 set_focus_on_creation(false); |
| 242 Init(params); | 240 Init(params); |
| 243 DCHECK_EQ(GetNativeView()->GetRootWindow(), parent->GetRootWindow()); | 241 DCHECK_EQ(GetNativeView()->GetRootWindow(), parent->GetRootWindow()); |
| 244 views::View* content_view = new views::View; | 242 views::View* content_view = new views::View; |
| 245 background_ = new CalloutWidgetBackground; | 243 background_ = new CalloutWidgetBackground; |
| 246 content_view->set_background(background_); | 244 content_view->set_background(background_); |
| 247 SetContentsView(content_view); | 245 SetContentsView(content_view); |
| 248 GetNativeWindow()->layer()->SetOpacity(0); | 246 GetNativeWindow()->layer()->SetOpacity(0); |
| 249 } | 247 } |
| 250 | 248 |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 // keyboard::KeyboardControllerObserver implementation: | 895 // keyboard::KeyboardControllerObserver implementation: |
| 898 | 896 |
| 899 void PanelLayoutManager::OnKeyboardBoundsChanging( | 897 void PanelLayoutManager::OnKeyboardBoundsChanging( |
| 900 const gfx::Rect& keyboard_bounds) { | 898 const gfx::Rect& keyboard_bounds) { |
| 901 // This bounds change will have caused a change to the Shelf which does not | 899 // This bounds change will have caused a change to the Shelf which does not |
| 902 // propogate automatically to this class, so manually recalculate bounds. | 900 // propogate automatically to this class, so manually recalculate bounds. |
| 903 OnWindowResized(); | 901 OnWindowResized(); |
| 904 } | 902 } |
| 905 | 903 |
| 906 } // namespace ash | 904 } // namespace ash |
| OLD | NEW |