| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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.h" | 5 #include "chrome/browser/external_tab_container.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/win_util.h" | 8 #include "app/win_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/win_util.h" | 10 #include "base/win_util.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 bool ExternalTabContainer::Init(Profile* profile, | 46 bool ExternalTabContainer::Init(Profile* profile, |
| 47 HWND parent, | 47 HWND parent, |
| 48 const gfx::Rect& bounds, | 48 const gfx::Rect& bounds, |
| 49 DWORD style) { | 49 DWORD style) { |
| 50 if (IsWindow()) { | 50 if (IsWindow()) { |
| 51 NOTREACHED(); | 51 NOTREACHED(); |
| 52 return false; | 52 return false; |
| 53 } | 53 } |
| 54 | 54 |
| 55 set_window_style(WS_POPUP); | 55 set_window_style(WS_POPUP); |
| 56 views::WidgetWin::Init(NULL, bounds); | 56 views::WidgetWin::Init(NULL, bounds, true); |
| 57 if (!IsWindow()) { | 57 if (!IsWindow()) { |
| 58 NOTREACHED(); | 58 NOTREACHED(); |
| 59 return false; | 59 return false; |
| 60 } | 60 } |
| 61 // TODO(jcampan): limit focus traversal to contents. | |
| 62 | 61 |
| 63 // We don't ever remove the prop because the lifetime of this object | 62 // We don't ever remove the prop because the lifetime of this object |
| 64 // is the same as the lifetime of the window | 63 // is the same as the lifetime of the window |
| 65 SetProp(GetNativeView(), kWindowObjectKey, this); | 64 SetProp(GetNativeView(), kWindowObjectKey, this); |
| 66 | 65 |
| 67 tab_contents_ = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL); | 66 tab_contents_ = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL); |
| 68 tab_contents_->set_delegate(this); | 67 tab_contents_->set_delegate(this); |
| 69 tab_contents_->render_view_host()->AllowExternalHostBindings(); | 68 tab_contents_->render_view_host()->AllowExternalHostBindings(); |
| 70 | 69 |
| 71 // Create a TabContentsContainer to handle focus cycling using Tab and | 70 // Create a TabContentsContainer to handle focus cycling using Tab and |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 if (tab_contents_) { | 412 if (tab_contents_) { |
| 414 NotificationService::current()->Notify( | 413 NotificationService::current()->Notify( |
| 415 NotificationType::EXTERNAL_TAB_CLOSED, | 414 NotificationType::EXTERNAL_TAB_CLOSED, |
| 416 Source<NavigationController>(&tab_contents_->controller()), | 415 Source<NavigationController>(&tab_contents_->controller()), |
| 417 Details<ExternalTabContainer>(this)); | 416 Details<ExternalTabContainer>(this)); |
| 418 | 417 |
| 419 delete tab_contents_; | 418 delete tab_contents_; |
| 420 tab_contents_ = NULL; | 419 tab_contents_ = NULL; |
| 421 } | 420 } |
| 422 } | 421 } |
| OLD | NEW |