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 <string> | 7 #include <string> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/win_util.h" | 10 #include "app/win_util.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/win_util.h" | 12 #include "base/win_util.h" |
13 #include "chrome/browser/automation/automation_provider.h" | 13 #include "chrome/browser/automation/automation_provider.h" |
14 #include "chrome/browser/browser_window.h" | 14 #include "chrome/browser/browser_window.h" |
| 15 #include "chrome/browser/debugger/devtools_manager.h" |
15 #include "chrome/browser/load_notification_details.h" | 16 #include "chrome/browser/load_notification_details.h" |
16 #include "chrome/browser/page_info_window.h" | 17 #include "chrome/browser/page_info_window.h" |
17 #include "chrome/browser/profile.h" | 18 #include "chrome/browser/profile.h" |
18 #include "chrome/browser/tab_contents/provisional_load_details.h" | 19 #include "chrome/browser/tab_contents/provisional_load_details.h" |
19 #include "chrome/browser/views/tab_contents/render_view_context_menu_external_wi
n.h" | 20 #include "chrome/browser/views/tab_contents/render_view_context_menu_external_wi
n.h" |
20 #include "chrome/browser/tab_contents/tab_contents.h" | 21 #include "chrome/browser/tab_contents/tab_contents.h" |
21 #include "chrome/browser/views/tab_contents/tab_contents_container.h" | 22 #include "chrome/browser/views/tab_contents/tab_contents_container.h" |
22 #include "chrome/common/bindings_policy.h" | 23 #include "chrome/common/bindings_policy.h" |
23 #include "chrome/common/chrome_constants.h" | 24 #include "chrome/common/chrome_constants.h" |
24 #include "chrome/common/notification_service.h" | 25 #include "chrome/common/notification_service.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 ::ShowWindow(tab_contents_->GetNativeView(), SW_SHOWNA); | 152 ::ShowWindow(tab_contents_->GetNativeView(), SW_SHOWNA); |
152 | 153 |
153 disabled_context_menu_ids_.push_back( | 154 disabled_context_menu_ids_.push_back( |
154 IDS_CONTENT_CONTEXT_OPENLINKOFFTHERECORD); | 155 IDS_CONTENT_CONTEXT_OPENLINKOFFTHERECORD); |
155 return true; | 156 return true; |
156 } | 157 } |
157 | 158 |
158 void ExternalTabContainer::Uninitialize() { | 159 void ExternalTabContainer::Uninitialize() { |
159 registrar_.RemoveAll(); | 160 registrar_.RemoveAll(); |
160 if (tab_contents_) { | 161 if (tab_contents_) { |
| 162 RenderViewHost* rvh = tab_contents_->render_view_host(); |
| 163 if (rvh && DevToolsManager::GetInstance()) { |
| 164 DevToolsManager::GetInstance()->UnregisterDevToolsClientHostFor(rvh); |
| 165 } |
| 166 |
161 NotificationService::current()->Notify( | 167 NotificationService::current()->Notify( |
162 NotificationType::EXTERNAL_TAB_CLOSED, | 168 NotificationType::EXTERNAL_TAB_CLOSED, |
163 Source<NavigationController>(&tab_contents_->controller()), | 169 Source<NavigationController>(&tab_contents_->controller()), |
164 Details<ExternalTabContainer>(this)); | 170 Details<ExternalTabContainer>(this)); |
165 | 171 |
166 delete tab_contents_; | 172 delete tab_contents_; |
167 tab_contents_ = NULL; | 173 tab_contents_ = NULL; |
168 } | 174 } |
169 } | 175 } |
170 | 176 |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 | 631 |
626 void ExternalTabContainer::Navigate(const GURL& url, const GURL& referrer) { | 632 void ExternalTabContainer::Navigate(const GURL& url, const GURL& referrer) { |
627 if (!tab_contents_) { | 633 if (!tab_contents_) { |
628 NOTREACHED(); | 634 NOTREACHED(); |
629 return; | 635 return; |
630 } | 636 } |
631 | 637 |
632 tab_contents_->controller().LoadURL(url, referrer, | 638 tab_contents_->controller().LoadURL(url, referrer, |
633 PageTransition::START_PAGE); | 639 PageTransition::START_PAGE); |
634 } | 640 } |
OLD | NEW |