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 "chrome/browser/chromeos/login/webui_login_view.h" | 5 #include "chrome/browser/chromeos/login/webui_login_view.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 gfx::NativeWindow WebUILoginView::GetNativeWindow() const { | 253 gfx::NativeWindow WebUILoginView::GetNativeWindow() const { |
254 return GetWidget()->GetNativeWindow(); | 254 return GetWidget()->GetNativeWindow(); |
255 } | 255 } |
256 | 256 |
257 void WebUILoginView::LoadURL(const GURL & url) { | 257 void WebUILoginView::LoadURL(const GURL & url) { |
258 webui_login_->LoadInitialURL(url); | 258 webui_login_->LoadInitialURL(url); |
259 webui_login_->RequestFocus(); | 259 webui_login_->RequestFocus(); |
260 | 260 |
261 // TODO(nkostylev): Use WebContentsObserver::RenderViewCreated to track | 261 // TODO(nkostylev): Use WebContentsObserver::RenderViewCreated to track |
262 // when RenderView is created. | 262 // when RenderView is created. |
263 // Use a background with transparency to trigger transparency in Webkit. | 263 GetWebContents()->GetRenderViewHost()->GetView()->SetBackgroundOpaque(false); |
264 SkBitmap background; | |
265 background.setConfig(SkBitmap::kARGB_8888_Config, 1, 1); | |
266 background.allocPixels(); | |
267 background.eraseARGB(0x00, 0x00, 0x00, 0x00); | |
268 content::RenderViewHost* host = GetWebContents()->GetRenderViewHost(); | |
269 host->GetView()->SetBackground(background); | |
270 } | 264 } |
271 | 265 |
272 content::WebUI* WebUILoginView::GetWebUI() { | 266 content::WebUI* WebUILoginView::GetWebUI() { |
273 return webui_login_->web_contents()->GetWebUI(); | 267 return webui_login_->web_contents()->GetWebUI(); |
274 } | 268 } |
275 | 269 |
276 content::WebContents* WebUILoginView::GetWebContents() { | 270 content::WebContents* WebUILoginView::GetWebContents() { |
277 return webui_login_->web_contents(); | 271 return webui_login_->web_contents(); |
278 } | 272 } |
279 | 273 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 webui_visible_ = true; | 451 webui_visible_ = true; |
458 } | 452 } |
459 | 453 |
460 void WebUILoginView::ReturnFocus(bool reverse) { | 454 void WebUILoginView::ReturnFocus(bool reverse) { |
461 // Return the focus to the web contents. | 455 // Return the focus to the web contents. |
462 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); | 456 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); |
463 GetWidget()->Activate(); | 457 GetWidget()->Activate(); |
464 } | 458 } |
465 | 459 |
466 } // namespace chromeos | 460 } // namespace chromeos |
OLD | NEW |