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

Unified Diff: chrome/browser/chromeos/tab_first_render_watcher.h

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/tab_first_render_watcher.h
diff --git a/chrome/browser/chromeos/tab_first_render_watcher.h b/chrome/browser/chromeos/tab_first_render_watcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..9f87051085a0cfde49866edf763392f67a29373b
--- /dev/null
+++ b/chrome/browser/chromeos/tab_first_render_watcher.h
@@ -0,0 +1,55 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_TAB_FIRST_RENDER_WATCHER_H_
+#define CHROME_BROWSER_CHROMEOS_TAB_FIRST_RENDER_WATCHER_H_
+#pragma once
+
+#include "base/compiler_specific.h"
+#include "content/common/notification_observer.h"
+#include "content/common/notification_registrar.h"
+
+class TabContents;
+
+namespace chromeos {
+
+// This class watches given TabContent's loading and rendering state change.
+// TODO(xiyuan): Move this to a proper place and share with HTMLDialogView.
+class TabFirstRenderWatcher : public NotificationObserver {
+ public:
+ class Delegate {
+ public:
+ virtual void OnTabMainFrameLoaded() = 0;
+ virtual void OnTabMainFrameFirstRender() = 0;
+ };
+
+ TabFirstRenderWatcher(TabContents* tab, Delegate* delegate);
+
+ private:
+ // Overridden from NotificationObserver
+ virtual void Observe(int type,
+ const NotificationSource& source,
+ const NotificationDetails& details) OVERRIDE;
+
+ enum State {
+ NONE,
+ LOADED, // Renderer loaded the page.
+ FIRST_PAINT, // 1st paint event after the page is loaded.
+ };
+ State state_;
+
+ // TabContents that this class watches.
+ TabContents* tab_contents_;
+
+ // Delegate to notify.
+ Delegate* delegate_;
+
+ NotificationRegistrar registrar_;
+
+ DISALLOW_COPY_AND_ASSIGN(TabFirstRenderWatcher);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_TAB_FIRST_RENDER_WATCHER_H_
« no previous file with comments | « chrome/browser/chromeos/login/webui_login_view.cc ('k') | chrome/browser/chromeos/tab_first_render_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698