| 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/win_util.h" | 7 #include "app/win_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/win_util.h" | 9 #include "base/win_util.h" |
| 10 #include "chrome/browser/automation/automation_provider.h" | 10 #include "chrome/browser/automation/automation_provider.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 bool ExternalTabContainer::Init(Profile* profile, | 42 bool ExternalTabContainer::Init(Profile* profile, |
| 43 HWND parent, | 43 HWND parent, |
| 44 const gfx::Rect& bounds, | 44 const gfx::Rect& bounds, |
| 45 DWORD style) { | 45 DWORD style) { |
| 46 if (IsWindow()) { | 46 if (IsWindow()) { |
| 47 NOTREACHED(); | 47 NOTREACHED(); |
| 48 return false; | 48 return false; |
| 49 } | 49 } |
| 50 | 50 |
| 51 set_window_style(WS_POPUP); | 51 set_window_style(WS_POPUP); |
| 52 views::WidgetWin::Init(parent, bounds, true); | 52 views::WidgetWin::Init(NULL, bounds, true); |
| 53 if (!IsWindow()) { |
| 54 NOTREACHED(); |
| 55 return false; |
| 56 } |
| 53 | 57 |
| 54 // We don't ever remove the prop because the lifetime of this object | 58 // We don't ever remove the prop because the lifetime of this object |
| 55 // is the same as the lifetime of the window | 59 // is the same as the lifetime of the window |
| 56 SetProp(GetNativeView(), kWindowObjectKey, this); | 60 SetProp(GetNativeView(), kWindowObjectKey, this); |
| 57 | 61 |
| 58 views::FocusManager* focus_manager = | 62 views::FocusManager* focus_manager = |
| 59 views::FocusManager::GetFocusManager(GetNativeView()); | 63 views::FocusManager::GetFocusManager(GetNativeView()); |
| 60 focus_manager->AddKeystrokeListener(this); | 64 focus_manager->AddKeystrokeListener(this); |
| 61 | 65 |
| 62 tab_contents_ = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL); | 66 tab_contents_ = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL); |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 NotificationService::current()->Notify( | 389 NotificationService::current()->Notify( |
| 386 NotificationType::EXTERNAL_TAB_CLOSED, | 390 NotificationType::EXTERNAL_TAB_CLOSED, |
| 387 Source<NavigationController>(&tab_contents_->controller()), | 391 Source<NavigationController>(&tab_contents_->controller()), |
| 388 Details<ExternalTabContainer>(this)); | 392 Details<ExternalTabContainer>(this)); |
| 389 | 393 |
| 390 delete tab_contents_; | 394 delete tab_contents_; |
| 391 tab_contents_ = NULL; | 395 tab_contents_ = NULL; |
| 392 } | 396 } |
| 393 } | 397 } |
| 394 | 398 |
| OLD | NEW |