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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "chrome/common/chrome_notification_types.h" | 22 #include "chrome/common/chrome_notification_types.h" |
23 #include "chrome/common/render_messages.h" | 23 #include "chrome/common/render_messages.h" |
24 #include "content/public/browser/notification_service.h" | 24 #include "content/public/browser/notification_service.h" |
25 #include "content/public/browser/render_view_host_observer.h" | 25 #include "content/public/browser/render_view_host_observer.h" |
26 #include "content/public/browser/web_contents.h" | 26 #include "content/public/browser/web_contents.h" |
27 #include "content/public/browser/web_ui.h" | 27 #include "content/public/browser/web_ui.h" |
28 #include "ui/gfx/rect.h" | 28 #include "ui/gfx/rect.h" |
29 #include "ui/gfx/size.h" | 29 #include "ui/gfx/size.h" |
30 #include "ui/views/widget/widget.h" | 30 #include "ui/views/widget/widget.h" |
31 | 31 |
32 #if defined(TOOLKIT_USES_GTK) | |
33 #include "chrome/browser/chromeos/legacy_window_manager/wm_ipc.h" | |
34 #include "ui/views/widget/native_widget_gtk.h" | |
35 #endif | |
36 | |
37 #if defined(USE_VIRTUAL_KEYBOARD) | 32 #if defined(USE_VIRTUAL_KEYBOARD) |
38 #include "chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.h" | 33 #include "chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.h" |
39 #endif | 34 #endif |
40 | 35 |
41 #if defined(USE_AURA) | 36 #if defined(USE_AURA) |
42 #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h" | 37 #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h" |
43 #endif | 38 #endif |
44 | 39 |
45 using content::RenderViewHost; | 40 using content::RenderViewHost; |
46 using content::WebContents; | 41 using content::WebContents; |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 host_window_frozen_ = static_cast<views::NativeWidgetGtk*>( | 212 host_window_frozen_ = static_cast<views::NativeWidgetGtk*>( |
218 GetWidget()->native_widget())->SuppressFreezeUpdates(); | 213 GetWidget()->native_widget())->SuppressFreezeUpdates(); |
219 #else | 214 #else |
220 // TODO(saintlou): Unclear if we need this for the !gtk case. | 215 // TODO(saintlou): Unclear if we need this for the !gtk case. |
221 // According to nkostylev it prevents the renderer from flashing with a | 216 // According to nkostylev it prevents the renderer from flashing with a |
222 // white solid background until the content is fully rendered. | 217 // white solid background until the content is fully rendered. |
223 #endif | 218 #endif |
224 } | 219 } |
225 | 220 |
226 void WebUILoginView::UpdateWindowType() { | 221 void WebUILoginView::UpdateWindowType() { |
227 #if defined(TOOLKIT_USES_GTK) | |
228 std::vector<int> params; | |
229 WmIpc::instance()->SetWindowType( | |
230 GTK_WIDGET(GetNativeWindow()), | |
231 WM_IPC_WINDOW_LOGIN_WEBUI, | |
232 ¶ms); | |
233 #endif | |
234 } | 222 } |
235 | 223 |
236 void WebUILoginView::LoadURL(const GURL & url) { | 224 void WebUILoginView::LoadURL(const GURL & url) { |
237 webui_login_->LoadURL(url); | 225 webui_login_->LoadURL(url); |
238 webui_login_->RequestFocus(); | 226 webui_login_->RequestFocus(); |
239 } | 227 } |
240 | 228 |
241 content::WebUI* WebUILoginView::GetWebUI() { | 229 content::WebUI* WebUILoginView::GetWebUI() { |
242 return webui_login_->dom_contents()->web_contents()->GetWebUI(); | 230 return webui_login_->dom_contents()->web_contents()->GetWebUI(); |
243 } | 231 } |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 } | 449 } |
462 | 450 |
463 void WebUILoginView::ReturnFocus(bool reverse) { | 451 void WebUILoginView::ReturnFocus(bool reverse) { |
464 // Return the focus to the web contents. | 452 // Return the focus to the web contents. |
465 webui_login_->dom_contents()->web_contents()-> | 453 webui_login_->dom_contents()->web_contents()-> |
466 FocusThroughTabTraversal(reverse); | 454 FocusThroughTabTraversal(reverse); |
467 GetWidget()->Activate(); | 455 GetWidget()->Activate(); |
468 } | 456 } |
469 | 457 |
470 } // namespace chromeos | 458 } // namespace chromeos |
OLD | NEW |