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

Unified Diff: chrome/browser/tab_contents/tab_contents_view.cc

Issue 6330007: Don't use GetAsTabContents. Send notifications from TabContentsView instead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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_contents/tab_contents_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents_view.cc
diff --git a/chrome/browser/tab_contents/tab_contents_view.cc b/chrome/browser/tab_contents/tab_contents_view.cc
index 47e71f2706af0ea586e542f3d912b7318775c200..25264f04b102904cecddd0904dd06e85c2bb7a61 100644
--- a/chrome/browser/tab_contents/tab_contents_view.cc
+++ b/chrome/browser/tab_contents/tab_contents_view.cc
@@ -11,6 +11,8 @@
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_delegate.h"
+#include "chrome/common/notification_service.h"
+#include "chrome/common/render_messages_params.h"
TabContentsView::TabContentsView(TabContents* tab_contents)
: tab_contents_(tab_contents) {
@@ -30,8 +32,7 @@ void TabContentsView::RenderViewCreated(RenderViewHost* host) {
void TabContentsView::CreateNewWindow(
int route_id,
- WindowContainerType window_container_type,
- const string16& frame_name) {
+ const ViewHostMsg_CreateWindow_Params& params) {
TabContents* new_contents = delegate_view_helper_.CreateNewWindow(
route_id,
tab_contents_->profile(),
@@ -39,11 +40,18 @@ void TabContentsView::CreateNewWindow(
DOMUIFactory::GetDOMUIType(tab_contents_->profile(),
tab_contents_->GetURL()),
tab_contents_,
- window_container_type,
- frame_name);
+ params.window_container_type,
+ params.frame_name);
- if (new_contents && tab_contents_->delegate())
- tab_contents_->delegate()->TabContentsCreated(new_contents);
+ if (new_contents) {
+ NotificationService::current()->Notify(
+ NotificationType::CREATING_NEW_WINDOW,
+ Source<TabContents>(tab_contents_),
+ Details<const ViewHostMsg_CreateWindow_Params>(&params));
+
+ if (tab_contents_->delegate())
+ tab_contents_->delegate()->TabContentsCreated(new_contents);
+ }
}
void TabContentsView::CreateNewWidget(int route_id,
« no previous file with comments | « chrome/browser/tab_contents/tab_contents_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698