OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/external_tab_container_win.h" | 5 #include "chrome/browser/external_tab_container_win.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "app/win_util.h" | 9 #include "app/win_util.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
326 automation_->Send(new AutomationMsg_NavigationStateChanged( | 326 automation_->Send(new AutomationMsg_NavigationStateChanged( |
327 0, tab_handle_, changed_flags, nav_info)); | 327 0, tab_handle_, changed_flags, nav_info)); |
328 } | 328 } |
329 } | 329 } |
330 | 330 |
331 void ExternalTabContainer::AddNewContents(TabContents* source, | 331 void ExternalTabContainer::AddNewContents(TabContents* source, |
332 TabContents* new_contents, | 332 TabContents* new_contents, |
333 WindowOpenDisposition disposition, | 333 WindowOpenDisposition disposition, |
334 const gfx::Rect& initial_pos, | 334 const gfx::Rect& initial_pos, |
335 bool user_gesture) { | 335 bool user_gesture) { |
336 DCHECK(automation_ != NULL); | 336 if (!automation_) { |
337 DCHECK(pending_); | |
338 LOG(ERROR) << "Invalid automation provider. Dropping new contents notify"; | |
339 delete new_contents; | |
amit
2010/07/16 22:25:38
we might have to do other cleanup corresponding to
| |
340 return; | |
341 } | |
337 | 342 |
338 scoped_refptr<ExternalTabContainer> new_container = | 343 scoped_refptr<ExternalTabContainer> new_container = |
339 new ExternalTabContainer(NULL, NULL); | 344 new ExternalTabContainer(NULL, NULL); |
340 | 345 |
341 // Make sure that ExternalTabContainer instance is initialized with | 346 // Make sure that ExternalTabContainer instance is initialized with |
342 // an unwrapped Profile. | 347 // an unwrapped Profile. |
343 bool result = new_container->Init( | 348 bool result = new_container->Init( |
344 new_contents->profile()->GetOriginalProfile(), | 349 new_contents->profile()->GetOriginalProfile(), |
345 NULL, | 350 NULL, |
346 initial_pos, | 351 initial_pos, |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
964 | 969 |
965 layout->StartRow(0, 0); | 970 layout->StartRow(0, 0); |
966 layout->AddView(info_bar_container); | 971 layout->AddView(info_bar_container); |
967 layout->StartRow(1, 0); | 972 layout->StartRow(1, 0); |
968 layout->AddView(tab_contents_container_); | 973 layout->AddView(tab_contents_container_); |
969 SetContentsView(external_tab_view_); | 974 SetContentsView(external_tab_view_); |
970 // Note that SetTabContents must be called after AddChildView is called | 975 // Note that SetTabContents must be called after AddChildView is called |
971 tab_contents_container_->ChangeTabContents(tab_contents_); | 976 tab_contents_container_->ChangeTabContents(tab_contents_); |
972 } | 977 } |
973 | 978 |
OLD | NEW |