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

Unified Diff: chrome/browser/ui/views/html_dialog_view.h

Issue 8417005: Share TabFirstRenderWatcher with HtmlDialogView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 9 years, 2 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
« no previous file with comments | « chrome/browser/tab_first_render_watcher_browsertest.cc ('k') | chrome/browser/ui/views/html_dialog_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/html_dialog_view.h
diff --git a/chrome/browser/ui/views/html_dialog_view.h b/chrome/browser/ui/views/html_dialog_view.h
index da8c3ad2f7d8c7d0422ef2b7bc80c737f9660137..5877c729464bc6d04ab1ac475932476d1cd24cb1 100644
--- a/chrome/browser/ui/views/html_dialog_view.h
+++ b/chrome/browser/ui/views/html_dialog_view.h
@@ -10,11 +10,11 @@
#include <vector>
#include "base/gtest_prod_util.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/tab_first_render_watcher.h"
#include "chrome/browser/ui/views/dom_view.h"
#include "chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h"
#include "chrome/browser/ui/webui/html_dialog_ui.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
#include "ui/gfx/size.h"
#include "views/widget/widget_delegate.h"
@@ -38,7 +38,7 @@ class HtmlDialogView
public HtmlDialogTabContentsDelegate,
public HtmlDialogUIDelegate,
public views::WidgetDelegate,
- public content::NotificationObserver {
+ public TabFirstRenderWatcher::Delegate {
public:
HtmlDialogView(Profile* profile, HtmlDialogUIDelegate* delegate);
virtual ~HtmlDialogView();
@@ -84,30 +84,25 @@ class HtmlDialogView
OVERRIDE;
virtual void CloseContents(TabContents* source) OVERRIDE;
- // Overridden from content::NotificationObserver
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
protected:
// Register accelerators for this dialog.
virtual void RegisterDialogAccelerators();
+ // TabFirstRenderWatcher::Delegate implementation.
+ virtual void OnRenderHostCreated(RenderViewHost* host) OVERRIDE;
+ virtual void OnTabMainFrameLoaded() OVERRIDE;
+ virtual void OnTabMainFrameFirstRender() OVERRIDE;
+
private:
- FRIEND_TEST_ALL_PREFIXES(HtmlDialogBrowserTest, TestStateTransition);
-
- // A state used to ensure that we show the window only after the
- // renderer painted the full page.
- enum DialogState {
- NONE,
- INITIALIZED, // FreezeUpdates property is set to prevent WM from showing
- // the window until the property is remoevd.
- LOADED, // Renderer loaded the page.
- PAINTED, // 1st paint event after the page is loaded.
- // FreezeUpdates property is removed to tell WM to shows
- // the window.
- };
- DialogState state_;
+ FRIEND_TEST_ALL_PREFIXES(HtmlDialogBrowserTest, WebContentRendered);
+
+ // Whether the view is initialized. That is, dialog acceleartors is registered
+ // and FreezeUpdates property is set to prevent WM from showing the window
+ // until the property is removed.
+ bool initialized_;
+
+ // Watches for TabContents rendering.
+ scoped_ptr<TabFirstRenderWatcher> tab_watcher_;
// This view is a delegate to the HTML content since it needs to get notified
// about when the dialog is closing. For all other actions (besides dialog
@@ -115,8 +110,6 @@ class HtmlDialogView
// using this variable.
HtmlDialogUIDelegate* delegate_;
- content::NotificationRegistrar notification_registrar_;
-
DISALLOW_COPY_AND_ASSIGN(HtmlDialogView);
};
« no previous file with comments | « chrome/browser/tab_first_render_watcher_browsertest.cc ('k') | chrome/browser/ui/views/html_dialog_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698