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

Unified Diff: chrome/browser/chromeos/login/webui_login_view.cc

Issue 7607011: [ChromeOS] Freezes WebUI OOBE/Login window until tab is rendered. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments in #1 Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/webui_login_view.cc
diff --git a/chrome/browser/chromeos/login/webui_login_view.cc b/chrome/browser/chromeos/login/webui_login_view.cc
index 5091cb15285b2938ba7f0d64043f3e038707228c..ba4c0af38835c194f49e436b321c7536312d858c 100644
--- a/chrome/browser/chromeos/login/webui_login_view.cc
+++ b/chrome/browser/chromeos/login/webui_login_view.cc
@@ -17,6 +17,7 @@
#include "content/browser/tab_contents/tab_contents.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
+#include "views/widget/native_widget_gtk.h"
#include "views/widget/widget.h"
namespace {
@@ -40,7 +41,8 @@ WebUILoginView::WebUILoginView()
: status_area_(NULL),
profile_(NULL),
webui_login_(NULL),
- status_window_(NULL) {
+ status_window_(NULL),
+ host_window_frozen_(false) {
accel_map_[views::Accelerator(ui::VKEY_Z, false, true, true)] =
kAccelNameAccessibility;
accel_map_[views::Accelerator(ui::VKEY_E, false, true, true)] =
@@ -64,6 +66,9 @@ void WebUILoginView::Init() {
webui_login_->Init(profile_, NULL);
webui_login_->SetVisible(true);
webui_login_->tab_contents()->set_delegate(this);
+
+ tab_watcher_.reset(new TabFirstRenderWatcher(webui_login_->tab_contents(),
+ this));
}
std::string WebUILoginView::GetClassName() const {
@@ -94,7 +99,9 @@ gfx::NativeWindow WebUILoginView::GetNativeWindow() const {
}
void WebUILoginView::OnWindowCreated() {
- InitStatusArea();
+ // Freezes host window update until the tab is rendered.
+ host_window_frozen_ = static_cast<views::NativeWidgetGtk*>(
+ GetWidget()->native_widget())->SuppressFreezeUpdates();
}
void WebUILoginView::UpdateWindowType() {
@@ -186,6 +193,21 @@ void WebUILoginView::OnLocaleChanged() {
SchedulePaint();
}
+void WebUILoginView::OnTabMainFrameLoaded() {
+}
+
+void WebUILoginView::OnTabMainFrameFirstRender() {
+ InitStatusArea();
+
+ if (host_window_frozen_) {
+ host_window_frozen_ = false;
+
+ // Unfreezes the host window since tab is rendereed now.
+ views::NativeWidgetGtk::UpdateFreezeUpdatesProperty(
+ GetNativeWindow(), false);
+ }
+}
+
void WebUILoginView::InitStatusArea() {
DCHECK(status_area_ == NULL);
DCHECK(status_window_ == NULL);
« no previous file with comments | « chrome/browser/chromeos/login/webui_login_view.h ('k') | chrome/browser/chromeos/tab_first_render_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698