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

Side by Side Diff: chrome/browser/ui/views/external_tab_container_win.cc

Issue 10938033: Switch BlockedContentTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/external_tab_container_win.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/external_tab_container_win.h" 5 #include "chrome/browser/ui/views/external_tab_container_win.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 (GetWindowLong(GetNativeView(), GWL_STYLE) & ~WS_POPUP) | style); 249 (GetWindowLong(GetNativeView(), GWL_STYLE) & ~WS_POPUP) | style);
250 250
251 // Now apply the parenting and style 251 // Now apply the parenting and style
252 if (parent) 252 if (parent)
253 SetParent(GetNativeView(), parent); 253 SetParent(GetNativeView(), parent);
254 254
255 ::ShowWindow(tab_contents_->web_contents()->GetNativeView(), SW_SHOWNA); 255 ::ShowWindow(tab_contents_->web_contents()->GetNativeView(), SW_SHOWNA);
256 256
257 LoadAccelerators(); 257 LoadAccelerators();
258 SetupExternalTabView(); 258 SetupExternalTabView();
259 tab_contents_->blocked_content_tab_helper()->set_delegate(this); 259 BlockedContentTabHelper::FromWebContents(tab_contents_->web_contents())->
260 set_delegate(this);
260 return true; 261 return true;
261 } 262 }
262 263
263 void ExternalTabContainerWin::Uninitialize() { 264 void ExternalTabContainerWin::Uninitialize() {
264 registrar_.RemoveAll(); 265 registrar_.RemoveAll();
265 if (tab_contents_.get()) { 266 if (tab_contents_.get()) {
266 UnregisterRenderViewHost( 267 UnregisterRenderViewHost(
267 tab_contents_->web_contents()->GetRenderViewHost()); 268 tab_contents_->web_contents()->GetRenderViewHost());
268 269
269 if (GetWidget()->GetRootView()) 270 if (GetWidget()->GetRootView())
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 automation_->Send(new AutomationMsg_CloseExternalTab(tab_handle_)); 562 automation_->Send(new AutomationMsg_CloseExternalTab(tab_handle_));
562 } 563 }
563 } 564 }
564 565
565 void ExternalTabContainerWin::MoveContents(WebContents* source, 566 void ExternalTabContainerWin::MoveContents(WebContents* source,
566 const gfx::Rect& pos) { 567 const gfx::Rect& pos) {
567 if (automation_ && is_popup_window_) 568 if (automation_ && is_popup_window_)
568 automation_->Send(new AutomationMsg_MoveWindow(tab_handle_, pos)); 569 automation_->Send(new AutomationMsg_MoveWindow(tab_handle_, pos));
569 } 570 }
570 571
571 TabContents* ExternalTabContainerWin::GetConstrainingTabContents( 572 content::WebContents* ExternalTabContainerWin::GetConstrainingWebContents(
572 TabContents* source) { 573 content::WebContents* source) {
573 return source; 574 return source;
574 } 575 }
575 576
576 ExternalTabContainerWin::~ExternalTabContainerWin() { 577 ExternalTabContainerWin::~ExternalTabContainerWin() {
577 Uninitialize(); 578 Uninitialize();
578 } 579 }
579 580
580 bool ExternalTabContainerWin::IsPopupOrPanel(const WebContents* source) const { 581 bool ExternalTabContainerWin::IsPopupOrPanel(const WebContents* source) const {
581 return is_popup_window_; 582 return is_popup_window_;
582 } 583 }
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 if (params.disposition == CURRENT_TAB) { 1273 if (params.disposition == CURRENT_TAB) {
1273 DCHECK(route_all_top_level_navigations_); 1274 DCHECK(route_all_top_level_navigations_);
1274 forward_params.disposition = NEW_FOREGROUND_TAB; 1275 forward_params.disposition = NEW_FOREGROUND_TAB;
1275 } 1276 }
1276 WebContents* new_contents = 1277 WebContents* new_contents =
1277 ExternalTabContainerWin::OpenURLFromTab(source, forward_params); 1278 ExternalTabContainerWin::OpenURLFromTab(source, forward_params);
1278 // support only one navigation for a dummy tab before it is killed. 1279 // support only one navigation for a dummy tab before it is killed.
1279 ::DestroyWindow(GetNativeView()); 1280 ::DestroyWindow(GetNativeView());
1280 return new_contents; 1281 return new_contents;
1281 } 1282 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/external_tab_container_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698