summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/automation/automation_provider_observers.cc6
-rw-r--r--chrome/browser/chromeos/notifications/balloon_view.cc17
-rw-r--r--chrome/browser/chromeos/notifications/balloon_view_host.cc2
-rw-r--r--chrome/browser/chromeos/notifications/balloon_view_host.h4
-rw-r--r--chrome/browser/notifications/balloon_host.cc133
-rw-r--r--chrome/browser/notifications/balloon_host.h75
-rw-r--r--chrome/browser/tab_contents/render_view_host_delegate_helper.cc4
-rw-r--r--chrome/browser/task_manager/task_manager_notification_resource_provider.cc9
-rw-r--r--chrome/browser/ui/cocoa/notifications/balloon_controller.mm14
-rw-r--r--chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.h8
-rw-r--r--chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.mm16
-rw-r--r--chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc9
-rw-r--r--chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.cc19
-rw-r--r--chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.h7
-rw-r--r--chrome/browser/ui/views/notifications/balloon_view.cc15
-rw-r--r--chrome/browser/ui/views/notifications/balloon_view_host.cc45
-rw-r--r--chrome/browser/ui/views/notifications/balloon_view_host.h7
-rw-r--r--content/browser/renderer_host/render_view_host.cc13
-rw-r--r--content/browser/tab_contents/tab_contents.cc24
-rw-r--r--content/browser/tab_contents/tab_contents.h11
-rw-r--r--content/browser/tab_contents/tab_contents_delegate.cc11
-rw-r--r--content/browser/tab_contents/tab_contents_delegate.h17
-rw-r--r--content/browser/tab_contents/tab_contents_observer.cc9
-rw-r--r--content/browser/tab_contents/tab_contents_observer.h3
24 files changed, 195 insertions, 283 deletions
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc
index 78f24b5..aa0fe0b 100644
--- a/chrome/browser/automation/automation_provider_observers.cc
+++ b/chrome/browser/automation/automation_provider_observers.cc
@@ -2459,8 +2459,10 @@ void GetAllNotificationsObserver::SendMessage() {
base::DictionaryValue* note = NotificationToJson(
&(*balloon_iter)->notification());
BalloonView* view = (*balloon_iter)->view();
- note->SetInteger("pid", base::GetProcId(
- view->GetHost()->render_view_host()->process()->GetHandle()));
+ note->SetInteger(
+ "pid",
+ base::GetProcId(view->GetHost()->tab_contents()->render_view_host()->
+ process()-> GetHandle()));
list->Append(note);
}
std::vector<const Notification*> queued_notes;
diff --git a/chrome/browser/chromeos/notifications/balloon_view.cc b/chrome/browser/chromeos/notifications/balloon_view.cc
index a14e2cb..24c8ddd 100644
--- a/chrome/browser/chromeos/notifications/balloon_view.cc
+++ b/chrome/browser/chromeos/notifications/balloon_view.cc
@@ -21,6 +21,7 @@
#include "chrome/common/chrome_notification_types.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_widget_host_view.h"
+#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "grit/generated_resources.h"
@@ -234,9 +235,11 @@ void BalloonViewImpl::Show(Balloon* balloon) {
void BalloonViewImpl::Update() {
stale_ = false;
- if (html_contents_->render_view_host())
- html_contents_->render_view_host()->NavigateToURL(
- balloon_->notification().content_url());
+ if (!html_contents_->tab_contents())
+ return;
+ html_contents_->tab_contents()->controller().LoadURL(
+ balloon_->notification().content_url(), GURL(),
+ content::PAGE_TRANSITION_LINK, std::string());
}
void BalloonViewImpl::Close(bool by_user) {
@@ -268,8 +271,9 @@ void BalloonViewImpl::Layout() {
SetBounds(x(), y(), size.width(), size.height());
html_contents_->view()->SetBounds(0, 0, size.width(), size.height());
- if (html_contents_->render_view_host()) {
- RenderWidgetHostView* view = html_contents_->render_view_host()->view();
+ if (html_contents_->tab_contents()) {
+ RenderWidgetHostView* view =
+ html_contents_->tab_contents()->render_view_host()->view();
if (view)
view->SetSize(size);
}
@@ -359,7 +363,8 @@ void BalloonViewImpl::DenyPermission() {
}
gfx::NativeView BalloonViewImpl::GetParentNativeView() {
- RenderWidgetHostView* view = html_contents_->render_view_host()->view();
+ RenderWidgetHostView* view =
+ html_contents_->tab_contents()->render_view_host()->view();
DCHECK(view);
return view->GetNativeView();
}
diff --git a/chrome/browser/chromeos/notifications/balloon_view_host.cc b/chrome/browser/chromeos/notifications/balloon_view_host.cc
index 177df72..bc05c34 100644
--- a/chrome/browser/chromeos/notifications/balloon_view_host.cc
+++ b/chrome/browser/chromeos/notifications/balloon_view_host.cc
@@ -30,7 +30,7 @@ bool BalloonViewHost::AddWebUIMessageCallback(
return ret.second;
}
-void BalloonViewHost::WebUISend(RenderViewHost* render_view_host,
+void BalloonViewHost::WebUISend(TabContents* tab,
const GURL& source_url,
const std::string& name,
const ListValue& args) {
diff --git a/chrome/browser/chromeos/notifications/balloon_view_host.h b/chrome/browser/chromeos/notifications/balloon_view_host.h
index 738b989..eca3f1d 100644
--- a/chrome/browser/chromeos/notifications/balloon_view_host.h
+++ b/chrome/browser/chromeos/notifications/balloon_view_host.h
@@ -38,8 +38,8 @@ class BalloonViewHost : public ::BalloonViewHost {
const MessageCallback& callback);
private:
- // RenderViewHostDelegate
- virtual void WebUISend(RenderViewHost* render_view_host,
+ // TabContentsDelegate
+ virtual void WebUISend(TabContents* tab,
const GURL& source_url,
const std::string& name,
const base::ListValue& args) OVERRIDE;
diff --git a/chrome/browser/notifications/balloon_host.cc b/chrome/browser/notifications/balloon_host.cc
index 9109d15..ee586cc 100644
--- a/chrome/browser/notifications/balloon_host.cc
+++ b/chrome/browser/notifications/balloon_host.cc
@@ -17,8 +17,9 @@
#include "content/browser/renderer_host/browser_render_process_host.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/site_instance.h"
-#include "content/public/browser/notification_service.h"
+#include "content/browser/tab_contents/tab_contents.h"
#include "content/common/view_messages.h"
+#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "content/public/common/bindings_policy.h"
#include "content/public/common/renderer_preferences.h"
@@ -26,24 +27,19 @@
#include "webkit/glue/webpreferences.h"
BalloonHost::BalloonHost(Balloon* balloon)
- : render_view_host_(NULL),
- balloon_(balloon),
+ : balloon_(balloon),
initialized_(false),
should_notify_on_disconnect_(false),
enable_web_ui_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(
extension_function_dispatcher_(balloon_->profile(), this)) {
- CHECK(balloon_);
- site_instance_ = SiteInstance::CreateSiteInstanceForURL(balloon_->profile(),
- GetURL());
+ site_instance_ = SiteInstance::CreateSiteInstanceForURL(
+ balloon_->profile(), balloon_->notification().content_url());
}
void BalloonHost::Shutdown() {
NotifyDisconnect();
- if (render_view_host_) {
- render_view_host_->Shutdown();
- render_view_host_ = NULL;
- }
+ tab_contents_.reset();
}
Browser* BalloonHost::GetBrowser() {
@@ -64,20 +60,18 @@ const string16& BalloonHost::GetSource() const {
return balloon_->notification().display_source();
}
-WebPreferences BalloonHost::GetWebkitPrefs() {
- WebPreferences web_prefs =
- RenderViewHostDelegateHelper::GetWebkitPrefs(render_view_host_);
- web_prefs.allow_scripts_to_close_windows = true;
- return web_prefs;
+void BalloonHost::CloseContents(TabContents* source) {
+ balloon_->CloseByScript();
+ NotifyDisconnect();
}
-const GURL& BalloonHost::GetURL() const {
- return balloon_->notification().content_url();
+void BalloonHost::HandleMouseDown() {
+ balloon_->OnClick();
}
-void BalloonHost::Close(RenderViewHost* render_view_host) {
- balloon_->CloseByScript();
- NotifyDisconnect();
+void BalloonHost::UpdatePreferredSize(TabContents* source,
+ const gfx::Size& pref_size) {
+ balloon_->SetContentPreferredSize(pref_size);
}
void BalloonHost::RenderViewCreated(RenderViewHost* render_view_host) {
@@ -86,9 +80,12 @@ void BalloonHost::RenderViewCreated(RenderViewHost* render_view_host) {
render_view_host->WasResized();
render_view_host->EnablePreferredSizeMode(
kPreferredSizeWidth | kPreferredSizeHeightThisIsSlow);
+
+ if (enable_web_ui_)
+ render_view_host->AllowBindings(content::BINDINGS_POLICY_WEB_UI);
}
-void BalloonHost::RenderViewReady(RenderViewHost* render_view_host) {
+void BalloonHost::RenderViewReady() {
should_notify_on_disconnect_ = true;
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_NOTIFY_BALLOON_CONNECTED,
@@ -96,18 +93,8 @@ void BalloonHost::RenderViewReady(RenderViewHost* render_view_host) {
content::NotificationService::NoDetails());
}
-void BalloonHost::RenderViewGone(RenderViewHost* render_view_host,
- base::TerminationStatus status,
- int error_code) {
- Close(render_view_host);
-}
-
-content::ViewType BalloonHost::GetRenderViewType() const {
- return chrome::VIEW_TYPE_NOTIFICATION;
-}
-
-RenderViewHostDelegate::View* BalloonHost::GetViewDelegate() {
- return this;
+void BalloonHost::RenderViewGone() {
+ CloseContents(tab_contents_.get());
}
bool BalloonHost::OnMessageReceived(const IPC::Message& message) {
@@ -120,86 +107,36 @@ bool BalloonHost::OnMessageReceived(const IPC::Message& message) {
}
void BalloonHost::OnRequest(const ExtensionHostMsg_Request_Params& params) {
- extension_function_dispatcher_.Dispatch(params, render_view_host_);
+ extension_function_dispatcher_.Dispatch(params,
+ tab_contents_->render_view_host());
}
-// RenderViewHostDelegate::View methods implemented to allow links to
-// open pages in new tabs.
-void BalloonHost::CreateNewWindow(
- int route_id,
- const ViewHostMsg_CreateWindow_Params& params) {
- delegate_view_helper_.CreateNewWindow(
- route_id,
+void BalloonHost::Init() {
+ DCHECK(!tab_contents_.get()) << "BalloonViewHost already initialized.";
+ tab_contents_.reset(new TabContents(
balloon_->profile(),
site_instance_.get(),
- ChromeWebUIFactory::GetInstance()->GetWebUIType(balloon_->profile(),
- balloon_->notification().content_url()),
- this,
- params.window_container_type,
- params.frame_name);
-}
-
-void BalloonHost::ShowCreatedWindow(int route_id,
- WindowOpenDisposition disposition,
- const gfx::Rect& initial_pos,
- bool user_gesture) {
- // Don't allow pop-ups from notifications.
- if (disposition == NEW_POPUP)
- return;
-
- TabContents* contents = delegate_view_helper_.GetCreatedWindow(route_id);
- if (!contents)
- return;
- Browser* browser = BrowserList::GetLastActiveWithProfile(balloon_->profile());
- if (!browser)
- return;
-
- browser->AddTabContents(contents, disposition, initial_pos, user_gesture);
-}
-
-void BalloonHost::UpdatePreferredSize(const gfx::Size& new_size) {
- balloon_->SetContentPreferredSize(new_size);
-}
-
-void BalloonHost::HandleMouseDown() {
- balloon_->OnClick();
-}
-
-content::RendererPreferences BalloonHost::GetRendererPrefs(
- content::BrowserContext* browser_context) const {
- Profile* profile = Profile::FromBrowserContext(browser_context);
- content::RendererPreferences preferences;
- renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile);
- return preferences;
-}
-
-void BalloonHost::Init() {
- DCHECK(!render_view_host_) << "BalloonViewHost already initialized.";
- RenderViewHost* rvh = new RenderViewHost(
- site_instance_.get(), this, MSG_ROUTING_NONE, NULL);
- if (enable_web_ui_)
- rvh->AllowBindings(content::BINDINGS_POLICY_WEB_UI);
-
- // Do platform-specific initialization.
- render_view_host_ = rvh;
- InitRenderWidgetHostView();
- DCHECK(render_widget_host_view());
+ MSG_ROUTING_NONE,
+ NULL,
+ NULL));
+ tab_contents_->set_view_type(chrome::VIEW_TYPE_NOTIFICATION);
+ tab_contents_->set_delegate(this);
+ Observe(tab_contents_.get());
- rvh->SetView(render_widget_host_view());
- rvh->CreateRenderView(string16());
- rvh->NavigateToURL(balloon_->notification().content_url());
+ tab_contents_->controller().LoadURL(
+ balloon_->notification().content_url(), GURL(),
+ content::PAGE_TRANSITION_LINK, std::string());
initialized_ = true;
}
void BalloonHost::EnableWebUI() {
- DCHECK(render_view_host_ == NULL) <<
+ DCHECK(!tab_contents_.get()) <<
"EnableWebUI has to be called before a renderer is created.";
enable_web_ui_ = true;
}
BalloonHost::~BalloonHost() {
- DCHECK(!render_view_host_);
}
void BalloonHost::NotifyDisconnect() {
diff --git a/chrome/browser/notifications/balloon_host.h b/chrome/browser/notifications/balloon_host.h
index e55cefa..06b5cdb 100644
--- a/chrome/browser/notifications/balloon_host.h
+++ b/chrome/browser/notifications/balloon_host.h
@@ -12,8 +12,9 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/extensions/extension_function_dispatcher.h"
-#include "chrome/browser/tab_contents/render_view_host_delegate_helper.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
+#include "content/browser/tab_contents/tab_contents_delegate.h"
+#include "content/browser/tab_contents/tab_contents_observer.h"
#include "content/public/browser/notification_registrar.h"
class Balloon;
@@ -26,8 +27,8 @@ namespace IPC {
class Message;
}
-class BalloonHost : public RenderViewHostDelegate,
- public RenderViewHostDelegate::View,
+class BalloonHost : public TabContentsDelegate,
+ public TabContentsObserver,
public ExtensionFunctionDispatcher::Delegate {
public:
explicit BalloonHost(Balloon* balloon);
@@ -43,55 +44,9 @@ class BalloonHost : public RenderViewHostDelegate,
virtual gfx::NativeView GetNativeViewOfHost();
virtual TabContents* GetAssociatedTabContents() const;
- RenderViewHost* render_view_host() const { return render_view_host_; }
-
const string16& GetSource() const;
- // RenderViewHostDelegate overrides.
- virtual WebPreferences GetWebkitPrefs() OVERRIDE;
- virtual const GURL& GetURL() const OVERRIDE;
- virtual void Close(RenderViewHost* render_view_host) OVERRIDE;
- virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE;
- virtual void RenderViewReady(RenderViewHost* render_view_host) OVERRIDE;
- virtual void RenderViewGone(RenderViewHost* render_view_host,
- base::TerminationStatus status,
- int error_code) OVERRIDE;
- virtual content::ViewType GetRenderViewType() const OVERRIDE;
- virtual RenderViewHostDelegate::View* GetViewDelegate() OVERRIDE;
- virtual void HandleMouseDown() OVERRIDE;
- virtual content::RendererPreferences GetRendererPrefs(
- content::BrowserContext* browser_context) const OVERRIDE;
- virtual void UpdatePreferredSize(const gfx::Size& pref_size) OVERRIDE;
-
- // RenderViewHostDelegate::View methods. Only the ones for opening new
- // windows are currently implemented.
- virtual void CreateNewWindow(
- int route_id,
- const ViewHostMsg_CreateWindow_Params& params) OVERRIDE;
- virtual void CreateNewWidget(int route_id,
- WebKit::WebPopupType popup_type) OVERRIDE {}
- virtual void CreateNewFullscreenWidget(int route_id) OVERRIDE {}
- virtual void ShowCreatedWindow(int route_id,
- WindowOpenDisposition disposition,
- const gfx::Rect& initial_pos,
- bool user_gesture) OVERRIDE;
- virtual void ShowCreatedWidget(int route_id,
- const gfx::Rect& initial_pos) OVERRIDE {}
- virtual void ShowCreatedFullscreenWidget(int route_id) OVERRIDE {}
- virtual void ShowContextMenu(const ContextMenuParams& params) OVERRIDE {}
- virtual void ShowPopupMenu(const gfx::Rect& bounds,
- int item_height,
- double item_font_size,
- int selected_item,
- const std::vector<WebMenuItem>& items,
- bool right_aligned) OVERRIDE {}
- virtual void StartDragging(const WebDropData&,
- WebKit::WebDragOperationsMask,
- const SkBitmap&,
- const gfx::Point&) OVERRIDE {}
- virtual void UpdateDragCursor(WebKit::WebDragOperation operation) OVERRIDE {}
- virtual void GotFocus() OVERRIDE {}
- virtual void TakeFocus(bool reverse) OVERRIDE {}
+ TabContents* tab_contents() const { return tab_contents_.get(); }
// Enable Web UI. This has to be called before renderer is created.
void EnableWebUI();
@@ -101,15 +56,20 @@ class BalloonHost : public RenderViewHostDelegate,
protected:
virtual ~BalloonHost();
- // Must override in platform specific implementations.
- virtual void InitRenderWidgetHostView() = 0;
- virtual RenderWidgetHostView* render_widget_host_view() const = 0;
- // Owned pointer to the host for the renderer process.
- RenderViewHost* render_view_host_;
+ scoped_ptr<TabContents> tab_contents_;
private:
- // RenderViewHostDelegate
+ // TabContentsDelegate implementation:
+ virtual void CloseContents(TabContents* source) OVERRIDE;
+ virtual void HandleMouseDown() OVERRIDE;
+ virtual void UpdatePreferredSize(TabContents* source,
+ const gfx::Size& pref_size) OVERRIDE;
+
+ // TabContentsObserver implementation:
+ virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE;
+ virtual void RenderViewReady() OVERRIDE;
+ virtual void RenderViewGone() OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
// Message handlers
@@ -133,9 +93,6 @@ class BalloonHost : public RenderViewHostDelegate,
// Site instance for the balloon/profile, to be used for opening new links.
scoped_refptr<SiteInstance> site_instance_;
- // Common implementations of some RenderViewHostDelegate::View methods.
- RenderViewHostDelegateViewHelper delegate_view_helper_;
-
// A flag to enable Web UI.
bool enable_web_ui_;
diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
index 28f4eda..ede1a3b9 100644
--- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
+++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
@@ -25,6 +25,7 @@
#include "chrome/browser/tab_contents/background_contents.h"
#include "chrome/browser/user_style_sheet_watcher.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/chrome_view_types.h"
#include "chrome/common/pref_names.h"
#include "content/browser/child_process_security_policy.h"
#include "content/browser/gpu/gpu_data_manager.h"
@@ -550,6 +551,9 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs(
extension_webkit_preferences::SetPreferences(&web_prefs, extension);
}
+ if (rvh->delegate()->GetRenderViewType() == chrome::VIEW_TYPE_NOTIFICATION)
+ web_prefs.allow_scripts_to_close_windows = true;
+
return web_prefs;
}
diff --git a/chrome/browser/task_manager/task_manager_notification_resource_provider.cc b/chrome/browser/task_manager/task_manager_notification_resource_provider.cc
index d6c2bc1..2db029f 100644
--- a/chrome/browser/task_manager/task_manager_notification_resource_provider.cc
+++ b/chrome/browser/task_manager/task_manager_notification_resource_provider.cc
@@ -12,8 +12,9 @@
#include "chrome/browser/notifications/balloon_host.h"
#include "chrome/browser/notifications/notification_ui_manager.h"
#include "chrome/common/chrome_notification_types.h"
-#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_process_host.h"
+#include "content/browser/renderer_host/render_view_host.h"
+#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/notification_service.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -35,7 +36,8 @@ TaskManagerNotificationResource::TaskManagerNotificationResource(
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
default_icon_ = rb.GetBitmapNamed(IDR_PLUGIN);
}
- process_handle_ = balloon_host_->render_view_host()->process()->GetHandle();
+ process_handle_ =
+ balloon_host_->tab_contents()->render_view_host()->process()->GetHandle();
pid_ = base::GetProcId(process_handle_);
title_ = l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_NOTIFICATION_PREFIX,
balloon_host_->GetSource());
@@ -69,7 +71,8 @@ bool TaskManagerNotificationResource::CanInspect() const {
}
void TaskManagerNotificationResource::Inspect() const {
- DevToolsWindow::OpenDevToolsWindow(balloon_host_->render_view_host());
+ DevToolsWindow::OpenDevToolsWindow(
+ balloon_host_->tab_contents()->render_view_host());
}
bool TaskManagerNotificationResource::SupportNetworkUsage() const {
diff --git a/chrome/browser/ui/cocoa/notifications/balloon_controller.mm b/chrome/browser/ui/cocoa/notifications/balloon_controller.mm
index b45838d..b5ebab8 100644
--- a/chrome/browser/ui/cocoa/notifications/balloon_controller.mm
+++ b/chrome/browser/ui/cocoa/notifications/balloon_controller.mm
@@ -19,6 +19,7 @@
#import "chrome/browser/ui/cocoa/notifications/balloon_view.h"
#include "chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.h"
#include "content/browser/renderer_host/render_view_host.h"
+#include "content/browser/tab_contents/tab_contents.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -174,9 +175,11 @@ const int kRightMargin = 2;
- (void)updateContents {
DCHECK(htmlContents_.get()) << "BalloonView::Update called before Show";
- if (htmlContents_->render_view_host())
- htmlContents_->render_view_host()->NavigateToURL(
- balloon_->notification().content_url());
+ if (htmlContents_->tab_contents()) {
+ htmlContents_->tab_contents()->controller().LoadURL(
+ balloon_->notification().content_url(), GURL(),
+ content::PAGE_TRANSITION_LINK, std::string());
+ }
}
- (void)repositionToBalloon {
@@ -186,11 +189,10 @@ const int kRightMargin = 2;
int w = [self desiredTotalWidth];
int h = [self desiredTotalHeight];
+ [[self window] setFrame:NSMakeRect(x, y, w, h)
+ display:YES];
if (htmlContents_.get())
htmlContents_->UpdateActualSize(balloon_->content_size());
-
- [[[self window] animator] setFrame:NSMakeRect(x, y, w, h)
- display:YES];
}
// Returns the total width the view should be to accommodate the balloon.
diff --git a/chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.h b/chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.h
index 4d87466..43096ee 100644
--- a/chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.h
+++ b/chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.h
@@ -27,15 +27,7 @@ class BalloonViewHost : public BalloonHost {
// Accessors.
gfx::NativeView native_view() const;
- protected:
- virtual void InitRenderWidgetHostView();
- virtual RenderWidgetHostView* render_widget_host_view() const;
-
private:
- // The Mac-specific widget host view. This is owned by its native view,
- // which this class frees in its destructor.
- RenderWidgetHostViewMac* render_widget_host_view_;
-
DISALLOW_COPY_AND_ASSIGN(BalloonViewHost);
};
diff --git a/chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.mm b/chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.mm
index 4fad1c0..4d71835 100644
--- a/chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.mm
+++ b/chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.mm
@@ -6,6 +6,8 @@
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_widget_host_view_mac.h"
+#include "content/browser/tab_contents/tab_contents.h"
+#include "content/browser/tab_contents/tab_contents_view.h"
BalloonViewHost::BalloonViewHost(Balloon* balloon)
: BalloonHost(balloon) {
@@ -16,7 +18,8 @@ BalloonViewHost::~BalloonViewHost() {
}
void BalloonViewHost::UpdateActualSize(const gfx::Size& new_size) {
- NSView* view = render_widget_host_view_->native_view();
+ tab_contents_->view()->SizeContents(new_size);
+ NSView* view = native_view();
NSRect frame = [view frame];
frame.size.width = new_size.width();
frame.size.height = new_size.height();
@@ -26,14 +29,5 @@ void BalloonViewHost::UpdateActualSize(const gfx::Size& new_size) {
}
gfx::NativeView BalloonViewHost::native_view() const {
- return render_widget_host_view_->native_view();
-}
-
-void BalloonViewHost::InitRenderWidgetHostView() {
- DCHECK(render_view_host_);
- render_widget_host_view_ = new RenderWidgetHostViewMac(render_view_host_);
-}
-
-RenderWidgetHostView* BalloonViewHost::render_widget_host_view() const {
- return render_widget_host_view_;
+ return tab_contents_->GetContentNativeView();
}
diff --git a/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc b/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc
index b49f72c..22734f8 100644
--- a/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc
+++ b/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc
@@ -32,6 +32,7 @@
#include "chrome/common/extensions/extension.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_widget_host_view.h"
+#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/notification_source.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -344,9 +345,11 @@ void BalloonViewImpl::Show(Balloon* balloon) {
void BalloonViewImpl::Update() {
DCHECK(html_contents_.get()) << "BalloonView::Update called before Show";
- if (html_contents_->render_view_host())
- html_contents_->render_view_host()->NavigateToURL(
- balloon_->notification().content_url());
+ if (!html_contents_->tab_contents())
+ return;
+ html_contents_->tab_contents()->controller().LoadURL(
+ balloon_->notification().content_url(), GURL(),
+ content::PAGE_TRANSITION_LINK, std::string());
}
gfx::Point BalloonViewImpl::GetContentsOffset() const {
diff --git a/chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.cc b/chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.cc
index 2f3da9d..ee44ae8 100644
--- a/chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.cc
+++ b/chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.cc
@@ -6,12 +6,11 @@
#include "chrome/browser/notifications/balloon.h"
#include "content/browser/renderer_host/render_view_host.h"
-#include "content/browser/renderer_host/render_widget_host_view.h"
#include "content/browser/renderer_host/render_widget_host_view_gtk.h"
+#include "content/browser/tab_contents/tab_contents.h"
BalloonViewHost::BalloonViewHost(Balloon* balloon)
- : BalloonHost(balloon),
- render_widget_host_view_(NULL) {
+ : BalloonHost(balloon) {
}
BalloonViewHost::~BalloonViewHost() {
@@ -19,21 +18,11 @@ BalloonViewHost::~BalloonViewHost() {
}
void BalloonViewHost::UpdateActualSize(const gfx::Size& new_size) {
- render_widget_host_view_->SetSize(new_size);
+ tab_contents_->render_view_host()->view()->SetSize(new_size);
gtk_widget_set_size_request(
native_view(), new_size.width(), new_size.height());
}
gfx::NativeView BalloonViewHost::native_view() const {
- return render_widget_host_view_->native_view();
-}
-
-void BalloonViewHost::InitRenderWidgetHostView() {
- DCHECK(render_view_host_);
- render_widget_host_view_ = new RenderWidgetHostViewGtk(render_view_host_);
- render_widget_host_view_->InitAsChild();
-}
-
-RenderWidgetHostView* BalloonViewHost::render_widget_host_view() const {
- return render_widget_host_view_;
+ return tab_contents_->GetNativeView();
}
diff --git a/chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.h b/chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.h
index 656ebb3..ef63643 100644
--- a/chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.h
+++ b/chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.h
@@ -27,14 +27,7 @@ class BalloonViewHost : public BalloonHost {
// Accessors.
gfx::NativeView native_view() const;
- protected:
- virtual void InitRenderWidgetHostView();
- virtual RenderWidgetHostView* render_widget_host_view() const;
-
private:
- // The GTK-specific widget host view. Owned by its native view.
- RenderWidgetHostViewGtk* render_widget_host_view_;
-
DISALLOW_COPY_AND_ASSIGN(BalloonViewHost);
};
diff --git a/chrome/browser/ui/views/notifications/balloon_view.cc b/chrome/browser/ui/views/notifications/balloon_view.cc
index 64ddc93..75b93fa 100644
--- a/chrome/browser/ui/views/notifications/balloon_view.cc
+++ b/chrome/browser/ui/views/notifications/balloon_view.cc
@@ -19,6 +19,7 @@
#include "chrome/common/chrome_notification_types.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_widget_host_view.h"
+#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
@@ -211,7 +212,8 @@ void BalloonViewImpl::RepositionToBalloon() {
gfx::Rect contents_rect = GetContentsRectangle();
html_container_->SetBounds(contents_rect);
html_contents_->SetPreferredSize(contents_rect.size());
- RenderWidgetHostView* view = html_contents_->render_view_host()->view();
+ RenderWidgetHostView* view =
+ html_contents_->tab_contents()->GetRenderWidgetHostView();
if (view)
view->SetSize(contents_rect.size());
return;
@@ -227,9 +229,11 @@ void BalloonViewImpl::RepositionToBalloon() {
void BalloonViewImpl::Update() {
DCHECK(html_contents_.get()) << "BalloonView::Update called before Show";
- if (html_contents_->render_view_host())
- html_contents_->render_view_host()->NavigateToURL(
- balloon_->notification().content_url());
+ if (!html_contents_->tab_contents())
+ return;
+ html_contents_->tab_contents()->controller().LoadURL(
+ balloon_->notification().content_url(), GURL(),
+ content::PAGE_TRANSITION_LINK, std::string());
}
void BalloonViewImpl::AnimationProgressed(const ui::Animation* animation) {
@@ -257,7 +261,8 @@ void BalloonViewImpl::AnimationProgressed(const ui::Animation* animation) {
html_container_->SetShape(path.CreateNativeRegion());
html_contents_->SetPreferredSize(contents_rect.size());
- RenderWidgetHostView* view = html_contents_->render_view_host()->view();
+ RenderWidgetHostView* view =
+ html_contents_->tab_contents()->GetRenderWidgetHostView();
if (view)
view->SetSize(contents_rect.size());
}
diff --git a/chrome/browser/ui/views/notifications/balloon_view_host.cc b/chrome/browser/ui/views/notifications/balloon_view_host.cc
index d018b6c..a59b374 100644
--- a/chrome/browser/ui/views/notifications/balloon_view_host.cc
+++ b/chrome/browser/ui/views/notifications/balloon_view_host.cc
@@ -7,13 +7,12 @@
#include "chrome/browser/notifications/balloon.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_widget_host_view.h"
+#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/content_browser_client.h"
#include "views/widget/widget.h"
#if defined(USE_AURA)
#include "content/browser/renderer_host/render_widget_host_view_aura.h"
-#elif defined(OS_WIN)
-#include "content/browser/renderer_host/render_widget_host_view_win.h"
#elif defined(TOUCH_UI)
#include "chrome/browser/renderer_host/render_widget_host_view_views.h"
#elif defined(TOOLKIT_USES_GTK)
@@ -56,45 +55,25 @@ BalloonViewHost::~BalloonViewHost() {
void BalloonViewHost::Init(gfx::NativeView parent_native_view) {
parent_native_view_ = parent_native_view;
BalloonHost::Init();
-}
-
-void BalloonViewHost::InitRenderWidgetHostView() {
- DCHECK(render_view_host_);
-
- render_widget_host_view_ =
- content::GetContentClient()->browser()->CreateViewForWidget(
- render_view_host_);
- // TODO(johnnyg): http://crbug.com/23954. Need a cross-platform solution.
+ RenderWidgetHostView* render_widget_host_view =
+ tab_contents_->render_view_host()->view();
#if defined(USE_AURA)
- RenderWidgetHostViewAura* view_aura =
- static_cast<RenderWidgetHostViewAura*>(render_widget_host_view_);
- view_aura->InitAsChild();
- view_aura->Show();
- native_host_->Attach(view_aura->GetNativeView());
+ // TODO(beng): (same as touch_ui probably).
+ NOTIMPLEMENTED();
#elif defined(OS_WIN)
- RenderWidgetHostViewWin* view_win =
- static_cast<RenderWidgetHostViewWin*>(render_widget_host_view_);
-
- // Create the HWND.
- HWND hwnd = view_win->Create(parent_native_view_);
- view_win->ShowWindow(SW_SHOW);
- native_host_->Attach(hwnd);
-#elif defined(TOUCH_UI)
+ native_host_->Attach(render_widget_host_view->GetNativeView());
+#elif defined(TOOLKIT_USES_GTK)
+#if defined(TOUCH_UI)
RenderWidgetHostViewViews* view_views =
- static_cast<RenderWidgetHostViewViews*>(render_widget_host_view_);
- view_views->InitAsChild();
+ static_cast<RenderWidgetHostViewViews*>(render_widget_host_view);
native_host_->AttachToView(view_views);
-#elif defined(TOOLKIT_USES_GTK)
+#else
RenderWidgetHostViewGtk* view_gtk =
- static_cast<RenderWidgetHostViewGtk*>(render_widget_host_view_);
- view_gtk->InitAsChild();
+ static_cast<RenderWidgetHostViewGtk*>(render_widget_host_view);
native_host_->Attach(view_gtk->native_view());
+#endif
#else
NOTIMPLEMENTED();
#endif
}
-
-RenderWidgetHostView* BalloonViewHost::render_widget_host_view() const {
- return render_widget_host_view_;
-}
diff --git a/chrome/browser/ui/views/notifications/balloon_view_host.h b/chrome/browser/ui/views/notifications/balloon_view_host.h
index e3b0a23..3ad8b07 100644
--- a/chrome/browser/ui/views/notifications/balloon_view_host.h
+++ b/chrome/browser/ui/views/notifications/balloon_view_host.h
@@ -35,14 +35,7 @@ class BalloonViewHost : public BalloonHost {
// Initialize the view, parented to |parent|, and show it.
void Init(gfx::NativeView parent);
- protected:
- virtual void InitRenderWidgetHostView();
- virtual RenderWidgetHostView* render_widget_host_view() const;
-
private:
- // The platform-specific widget host view. Pointer is owned by the RVH.
- RenderWidgetHostView* render_widget_host_view_;
-
// The views-specific host view. Pointer owned by the views hierarchy.
views::NativeViewHost* native_host_;
diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc
index b9e2cfa..2228aaf 100644
--- a/content/browser/renderer_host/render_view_host.cc
+++ b/content/browser/renderer_host/render_view_host.cc
@@ -168,11 +168,6 @@ bool RenderViewHost::CreateRenderView(const string16& frame_name) {
DCHECK(process()->HasConnection());
DCHECK(process()->browser_context());
- if (enabled_bindings_ & content::BINDINGS_POLICY_WEB_UI) {
- ChildProcessSecurityPolicy::GetInstance()->GrantWebUIBindings(
- process()->id());
- }
-
renderer_initialized_ = true;
process()->SetCompositingSurface(routing_id(),
@@ -569,8 +564,14 @@ void RenderViewHost::DragSourceSystemDragEnded() {
}
void RenderViewHost::AllowBindings(int bindings_flags) {
- DCHECK(!renderer_initialized_);
+ if (bindings_flags & content::BINDINGS_POLICY_WEB_UI) {
+ ChildProcessSecurityPolicy::GetInstance()->GrantWebUIBindings(
+ process()->id());
+ }
+
enabled_bindings_ |= bindings_flags;
+ if (renderer_initialized_)
+ Send(new ViewMsg_AllowBindings(routing_id(), enabled_bindings_));
}
void RenderViewHost::SetWebUIProperty(const std::string& name,
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 5e76850..03c0fdd 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -47,7 +47,6 @@
#include "content/public/common/content_constants.h"
#include "content/public/common/content_restriction.h"
#include "content/public/common/url_constants.h"
-#include "content/public/common/view_types.h"
#include "net/base/net_util.h"
#include "net/url_request/url_request_context_getter.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
@@ -202,7 +201,8 @@ TabContents::TabContents(content::BrowserContext* browser_context,
maximum_zoom_percent_(
static_cast<int>(WebKit::WebView::maxTextSizeMultiplier * 100)),
temporary_zoom_settings_(false),
- content_restrictions_(0) {
+ content_restrictions_(0),
+ view_type_(content::VIEW_TYPE_TAB_CONTENTS) {
render_manager_.Init(browser_context, site_instance, routing_id);
@@ -484,6 +484,11 @@ void TabContents::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
delegate_->HandleKeyboardEvent(event);
}
+void TabContents::HandleMouseDown() {
+ if (delegate_)
+ delegate_->HandleMouseDown();
+}
+
void TabContents::HandleMouseUp() {
if (delegate_)
delegate_->HandleMouseUp();
@@ -521,6 +526,14 @@ void TabContents::UpdatePreferredSize(const gfx::Size& pref_size) {
delegate_->UpdatePreferredSize(this, pref_size);
}
+void TabContents::WebUISend(RenderViewHost* render_view_host,
+ const GURL& source_url,
+ const std::string& name,
+ const base::ListValue& args) {
+ if (delegate_)
+ delegate_->WebUISend(this, source_url, name, args);
+}
+
void TabContents::ShowContents() {
RenderWidgetHostView* rwhv = GetRenderWidgetHostView();
if (rwhv)
@@ -588,6 +601,9 @@ bool TabContents::NavigateToEntry(
bool is_allowed_in_web_ui_renderer = content::GetContentClient()->
browser()->GetWebUIFactory()->IsURLAcceptableForWebUI(browser_context(),
entry.url());
+#if defined(OS_CHROMEOS)
+ is_allowed_in_web_ui_renderer |= entry.url().SchemeIs(chrome::kDataScheme);
+#endif
CHECK(!(enabled_bindings & content::BINDINGS_POLICY_WEB_UI) ||
is_allowed_in_web_ui_renderer);
@@ -1408,7 +1424,7 @@ TabContents* TabContents::GetAsTabContents() {
}
content::ViewType TabContents::GetRenderViewType() const {
- return content::VIEW_TYPE_TAB_CONTENTS;
+ return view_type_;
}
void TabContents::RenderViewCreated(RenderViewHost* render_view_host) {
@@ -1454,6 +1470,8 @@ void TabContents::RenderViewReady(RenderViewHost* rvh) {
(!delegate_ || delegate_->ShouldFocusPageAfterCrash())) {
Focus();
}
+
+ FOR_EACH_OBSERVER(TabContentsObserver, observers_, RenderViewReady());
}
void TabContents::RenderViewGone(RenderViewHost* rvh,
diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h
index 8a99fda..b4a8d40 100644
--- a/content/browser/tab_contents/tab_contents.h
+++ b/content/browser/tab_contents/tab_contents.h
@@ -103,6 +103,9 @@ class CONTENT_EXPORT TabContents : public PageNavigator,
return controller_.browser_context();
}
+ // Allows overriding the type of this tab.
+ void set_view_type(content::ViewType type) { view_type_ = type; }
+
// Returns the SavePackage which manages the page saving job. May be NULL.
SavePackage* save_package() const { return save_package_.get(); }
@@ -683,6 +686,7 @@ class CONTENT_EXPORT TabContents : public PageNavigator,
bool* is_keyboard_shortcut) OVERRIDE;
virtual void HandleKeyboardEvent(
const NativeWebKeyboardEvent& event) OVERRIDE;
+ virtual void HandleMouseDown() OVERRIDE;
virtual void HandleMouseUp() OVERRIDE;
virtual void HandleMouseActivate() OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message);
@@ -691,6 +695,10 @@ class CONTENT_EXPORT TabContents : public PageNavigator,
virtual void ToggleFullscreenMode(bool enter_fullscreen) OVERRIDE;
virtual bool IsFullscreenForCurrentTab() const OVERRIDE;
virtual void UpdatePreferredSize(const gfx::Size& pref_size) OVERRIDE;
+ virtual void WebUISend(RenderViewHost* render_view_host,
+ const GURL& source_url,
+ const std::string& name,
+ const base::ListValue& args) OVERRIDE;
virtual void RequestToLockMouse() OVERRIDE;
virtual void LostMouseLock() OVERRIDE;
@@ -859,6 +867,9 @@ class CONTENT_EXPORT TabContents : public PageNavigator,
// (full-page plugins for now only) permissions.
int content_restrictions_;
+ // Our view type. Default is VIEW_TYPE_TAB_CONTENTS.
+ content::ViewType view_type_;
+
DISALLOW_COPY_AND_ASSIGN(TabContents);
};
diff --git a/content/browser/tab_contents/tab_contents_delegate.cc b/content/browser/tab_contents/tab_contents_delegate.cc
index fcd1ba4..27b95aa 100644
--- a/content/browser/tab_contents/tab_contents_delegate.cc
+++ b/content/browser/tab_contents/tab_contents_delegate.cc
@@ -186,6 +186,9 @@ void TabContentsDelegate::HandleKeyboardEvent(
const NativeWebKeyboardEvent& event) {
}
+void TabContentsDelegate::HandleMouseDown() {
+}
+
void TabContentsDelegate::HandleMouseUp() {
}
@@ -324,10 +327,16 @@ void TabContentsDelegate::CrashedPlugin(TabContents* tab,
const FilePath& plugin_path) {
}
-void TabContentsDelegate::UpdatePreferredSize(TabContents* source,
+void TabContentsDelegate::UpdatePreferredSize(TabContents* tab,
const gfx::Size& pref_size) {
}
+void TabContentsDelegate::WebUISend(TabContents* tab,
+ const GURL& source_url,
+ const std::string& name,
+ const base::ListValue& args) {
+}
+
void TabContentsDelegate::RequestToLockMouse(TabContents* tab) {
}
diff --git a/content/browser/tab_contents/tab_contents_delegate.h b/content/browser/tab_contents/tab_contents_delegate.h
index 24c38d9..8b095fe 100644
--- a/content/browser/tab_contents/tab_contents_delegate.h
+++ b/content/browser/tab_contents/tab_contents_delegate.h
@@ -17,15 +17,19 @@
#include "ui/gfx/native_widget_types.h"
#include "webkit/glue/window_open_disposition.h"
-struct ContextMenuParams;
class DownloadItem;
class FilePath;
class GURL;
+class TabContents;
+struct ContextMenuParams;
struct NativeWebKeyboardEvent;
struct OpenURLParams;
-class TabContents;
struct ViewHostMsg_RunFileChooser_Params;
+namespace base {
+class ListValue;
+}
+
namespace content {
class BrowserContext;
class JavaScriptDialogCreator;
@@ -240,6 +244,7 @@ class CONTENT_EXPORT TabContentsDelegate {
// the renderer.
virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event);
+ virtual void HandleMouseDown();
virtual void HandleMouseUp();
virtual void HandleMouseActivate();
@@ -344,9 +349,15 @@ class CONTENT_EXPORT TabContentsDelegate {
virtual void CrashedPlugin(TabContents* tab, const FilePath& plugin_path);
// Invoked when the preferred size of the contents has been changed.
- virtual void UpdatePreferredSize(TabContents* source,
+ virtual void UpdatePreferredSize(TabContents* tab,
const gfx::Size& pref_size);
+ // Notification message from HTML UI.
+ virtual void WebUISend(TabContents* tab,
+ const GURL& source_url,
+ const std::string& name,
+ const base::ListValue& args);
+
// Requests to lock the mouse. Once the request is approved or rejected,
// GotResponseToLockMouseRequest() will be called on the requesting tab
// contents.
diff --git a/content/browser/tab_contents/tab_contents_observer.cc b/content/browser/tab_contents/tab_contents_observer.cc
index c18b1f3..dbde131 100644
--- a/content/browser/tab_contents/tab_contents_observer.cc
+++ b/content/browser/tab_contents/tab_contents_observer.cc
@@ -14,6 +14,12 @@ void TabContentsObserver::RenderViewCreated(RenderViewHost* render_view_host) {
void TabContentsObserver::RenderViewDeleted(RenderViewHost* render_view_host) {
}
+void TabContentsObserver::RenderViewReady() {
+}
+
+void TabContentsObserver::RenderViewGone() {
+}
+
void TabContentsObserver::NavigateToPendingEntry(
const GURL& url,
NavigationController::ReloadType reload_type) {
@@ -78,9 +84,6 @@ void TabContentsObserver::DidStartLoading() {
void TabContentsObserver::DidStopLoading() {
}
-void TabContentsObserver::RenderViewGone() {
-}
-
void TabContentsObserver::StopNavigation() {
}
diff --git a/content/browser/tab_contents/tab_contents_observer.h b/content/browser/tab_contents/tab_contents_observer.h
index aed69ec..469fb60 100644
--- a/content/browser/tab_contents/tab_contents_observer.h
+++ b/content/browser/tab_contents/tab_contents_observer.h
@@ -21,6 +21,8 @@ class CONTENT_EXPORT TabContentsObserver : public IPC::Channel::Listener,
public:
virtual void RenderViewCreated(RenderViewHost* render_view_host);
virtual void RenderViewDeleted(RenderViewHost* render_view_host);
+ virtual void RenderViewReady();
+ virtual void RenderViewGone();
virtual void NavigateToPendingEntry(
const GURL& url,
NavigationController::ReloadType reload_type);
@@ -58,7 +60,6 @@ class CONTENT_EXPORT TabContentsObserver : public IPC::Channel::Listener,
virtual void DidStartLoading();
virtual void DidStopLoading();
- virtual void RenderViewGone();
virtual void StopNavigation();
virtual void DidOpenURL(const GURL& url,