| 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/screensaver/screensaver_view.h" | 5 #include "ash/screensaver/screensaver_view.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 void ScreensaverView::LoadScreensaver() { | 137 void ScreensaverView::LoadScreensaver() { |
| 138 screensaver_webview_->GetWebContents()->GetController().LoadURL( | 138 screensaver_webview_->GetWebContents()->GetController().LoadURL( |
| 139 url_, | 139 url_, |
| 140 content::Referrer(), | 140 content::Referrer(), |
| 141 content::PAGE_TRANSITION_AUTO_TOPLEVEL, | 141 content::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 142 std::string()); | 142 std::string()); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void ScreensaverView::ShowWindow() { | 145 void ScreensaverView::ShowWindow() { |
| 146 aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow(); | 146 aura::Window* root_window = ash::Shell::GetPrimaryRootWindow(); |
| 147 gfx::Rect screen_rect = | 147 gfx::Rect screen_rect = |
| 148 Shell::GetScreen()->GetDisplayNearestWindow(root_window).bounds(); | 148 Shell::GetScreen()->GetDisplayNearestWindow(root_window).bounds(); |
| 149 | 149 |
| 150 // We want to be the fullscreen topmost child of the root window. | 150 // We want to be the fullscreen topmost child of the root window. |
| 151 // There should be nothing ever really that should show up on top of us. | 151 // There should be nothing ever really that should show up on top of us. |
| 152 container_window_ = new views::Widget(); | 152 container_window_ = new views::Widget(); |
| 153 views::Widget::InitParams params( | 153 views::Widget::InitParams params( |
| 154 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 154 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| 155 params.delegate = this; | 155 params.delegate = this; |
| 156 params.parent = root_window; | 156 params.parent = root_window; |
| 157 container_window_->Init(params); | 157 container_window_->Init(params); |
| 158 | 158 |
| 159 container_window_->StackAtTop(); | 159 container_window_->StackAtTop(); |
| 160 container_window_->SetBounds(screen_rect); | 160 container_window_->SetBounds(screen_rect); |
| 161 container_window_->Show(); | 161 container_window_->Show(); |
| 162 } | 162 } |
| 163 | 163 |
| 164 // static | 164 // static |
| 165 ScreensaverView* ScreensaverView::GetInstance() { | 165 ScreensaverView* ScreensaverView::GetInstance() { |
| 166 return g_instance; | 166 return g_instance; |
| 167 } | 167 } |
| 168 | 168 |
| 169 } // namespace internal | 169 } // namespace internal |
| 170 } // namespace ash | 170 } // namespace ash |
| OLD | NEW |