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

Side by Side Diff: chrome/browser/chromeos/login/webui_login_view.cc

Issue 10454017: [cros] Add support for transparent background in sign in screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build Created 8 years, 6 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) 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"
11 #include "base/command_line.h"
11 #include "base/i18n/rtl.h" 12 #include "base/i18n/rtl.h"
12 #include "base/utf_string_conversions.h" 13 #include "base/utf_string_conversions.h"
13 #include "base/values.h" 14 #include "base/values.h"
14 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" 15 #include "chrome/browser/chromeos/accessibility/accessibility_util.h"
15 #include "chrome/browser/chromeos/cros/cros_library.h" 16 #include "chrome/browser/chromeos/cros/cros_library.h"
17 #include "chrome/browser/chromeos/login/base_login_display_host.h"
16 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h" 18 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h"
17 #include "chrome/browser/chromeos/login/webui_login_display.h" 19 #include "chrome/browser/chromeos/login/webui_login_display.h"
18 #include "chrome/browser/profiles/profile_manager.h" 20 #include "chrome/browser/profiles/profile_manager.h"
19 #include "chrome/browser/renderer_preferences_util.h" 21 #include "chrome/browser/renderer_preferences_util.h"
20 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 22 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
21 #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h" 23 #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h"
22 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" 24 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
23 #include "chrome/common/chrome_notification_types.h" 25 #include "chrome/common/chrome_notification_types.h"
26 #include "chrome/common/chrome_switches.h"
24 #include "chrome/common/render_messages.h" 27 #include "chrome/common/render_messages.h"
25 #include "chromeos/dbus/dbus_thread_manager.h" 28 #include "chromeos/dbus/dbus_thread_manager.h"
26 #include "chromeos/dbus/session_manager_client.h" 29 #include "chromeos/dbus/session_manager_client.h"
27 #include "content/public/browser/notification_service.h" 30 #include "content/public/browser/notification_service.h"
31 #include "content/public/browser/render_view_host.h"
28 #include "content/public/browser/render_view_host_observer.h" 32 #include "content/public/browser/render_view_host_observer.h"
33 #include "content/public/browser/render_widget_host_view.h"
29 #include "content/public/browser/web_contents.h" 34 #include "content/public/browser/web_contents.h"
30 #include "content/public/browser/web_ui.h" 35 #include "content/public/browser/web_ui.h"
31 #include "ui/gfx/rect.h" 36 #include "ui/gfx/rect.h"
32 #include "ui/gfx/size.h" 37 #include "ui/gfx/size.h"
33 #include "ui/views/controls/webview/webview.h" 38 #include "ui/views/controls/webview/webview.h"
34 #include "ui/views/widget/widget.h" 39 #include "ui/views/widget/widget.h"
35 40
36 using content::NativeWebKeyboardEvent; 41 using content::NativeWebKeyboardEvent;
37 using content::RenderViewHost; 42 using content::RenderViewHost;
38 using content::WebContents; 43 using content::WebContents;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 201
197 void WebUILoginView::OnWindowCreated() { 202 void WebUILoginView::OnWindowCreated() {
198 } 203 }
199 204
200 void WebUILoginView::UpdateWindowType() { 205 void WebUILoginView::UpdateWindowType() {
201 } 206 }
202 207
203 void WebUILoginView::LoadURL(const GURL & url) { 208 void WebUILoginView::LoadURL(const GURL & url) {
204 webui_login_->LoadInitialURL(url); 209 webui_login_->LoadInitialURL(url);
205 webui_login_->RequestFocus(); 210 webui_login_->RequestFocus();
211
212 CommandLine* command_line = CommandLine::ForCurrentProcess();
213 // Only enable transparency on sign in screen, not on lock screen.
214 if (BaseLoginDisplayHost::default_host() &&
215 command_line->HasSwitch(switches::kEnableNewOobe)) {
216 // TODO(nkostylev): Use WebContentsObserver::RenderViewCreated to track
217 // when RenderView is created.
218 // Use a background with transparency to trigger transparency in Webkit.
219 SkBitmap background;
220 background.setConfig(SkBitmap::kARGB_8888_Config, 1, 1);
221 background.allocPixels();
222 background.eraseARGB(0x00, 0x00, 0x00, 0x00);
223 content::RenderViewHost* host =
224 wrapper_->web_contents()->GetRenderViewHost();
225 host->GetView()->SetBackground(background);
226 }
206 } 227 }
207 228
208 content::WebUI* WebUILoginView::GetWebUI() { 229 content::WebUI* WebUILoginView::GetWebUI() {
209 return webui_login_->web_contents()->GetWebUI(); 230 return webui_login_->web_contents()->GetWebUI();
210 } 231 }
211 232
212 void WebUILoginView::OpenProxySettings() { 233 void WebUILoginView::OpenProxySettings() {
213 ProxySettingsDialog* dialog = 234 ProxySettingsDialog* dialog =
214 new ProxySettingsDialog(NULL, GetNativeWindow()); 235 new ProxySettingsDialog(NULL, GetNativeWindow());
215 dialog->Show(); 236 dialog->Show();
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 return true; 349 return true;
329 } 350 }
330 351
331 void WebUILoginView::ReturnFocus(bool reverse) { 352 void WebUILoginView::ReturnFocus(bool reverse) {
332 // Return the focus to the web contents. 353 // Return the focus to the web contents.
333 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); 354 webui_login_->web_contents()->FocusThroughTabTraversal(reverse);
334 GetWidget()->Activate(); 355 GetWidget()->Activate();
335 } 356 }
336 357
337 } // namespace chromeos 358 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/webui_login_display_host.cc ('k') | chrome/browser/resources/chromeos/login/login.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698