| 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/tab_contents/tab_contents.h" | 5 #include "chrome/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #if defined(OS_CHROMEOS) | 7 #if defined(OS_CHROMEOS) |
| 8 // For GdkScreen | 8 // For GdkScreen |
| 9 #include <gdk/gdk.h> | 9 #include <gdk/gdk.h> |
| 10 #endif // defined(OS_CHROMEOS) | 10 #endif // defined(OS_CHROMEOS) |
| (...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1362 bool TabContents::ShouldAcceptDragAndDrop() const { | 1362 bool TabContents::ShouldAcceptDragAndDrop() const { |
| 1363 #if defined(OS_CHROMEOS) | 1363 #if defined(OS_CHROMEOS) |
| 1364 // ChromeOS panels (pop-ups) do not take drag-n-drop. | 1364 // ChromeOS panels (pop-ups) do not take drag-n-drop. |
| 1365 // See http://crosbug.com/2413 | 1365 // See http://crosbug.com/2413 |
| 1366 return delegate() && !delegate()->IsPopup(const_cast<TabContents*>(this)); | 1366 return delegate() && !delegate()->IsPopup(const_cast<TabContents*>(this)); |
| 1367 #else | 1367 #else |
| 1368 return true; | 1368 return true; |
| 1369 #endif | 1369 #endif |
| 1370 } | 1370 } |
| 1371 | 1371 |
| 1372 TabContents* TabContents::CloneAndMakePhantom() { | |
| 1373 TabNavigation tab_nav; | |
| 1374 | |
| 1375 NavigationEntry* entry = controller().GetActiveEntry(); | |
| 1376 if (extension_app_) | |
| 1377 tab_nav.set_virtual_url(extension_app_->GetFullLaunchURL()); | |
| 1378 else if (entry) | |
| 1379 tab_nav.SetFromNavigationEntry(*entry); | |
| 1380 | |
| 1381 std::vector<TabNavigation> navigations; | |
| 1382 navigations.push_back(tab_nav); | |
| 1383 | |
| 1384 TabContents* new_contents = | |
| 1385 new TabContents(profile(), NULL, MSG_ROUTING_NONE, NULL); | |
| 1386 new_contents->SetExtensionApp(extension_app_); | |
| 1387 new_contents->controller().RestoreFromState(navigations, 0, false); | |
| 1388 | |
| 1389 if (!extension_app_ && entry) | |
| 1390 new_contents->controller().GetActiveEntry()->favicon() = entry->favicon(); | |
| 1391 | |
| 1392 return new_contents; | |
| 1393 } | |
| 1394 | |
| 1395 // Resets the |content_blocked_| array. | 1372 // Resets the |content_blocked_| array. |
| 1396 void TabContents::ClearBlockedContentSettings() { | 1373 void TabContents::ClearBlockedContentSettings() { |
| 1397 for (size_t i = 0; i < arraysize(content_blocked_); ++i) | 1374 for (size_t i = 0; i < arraysize(content_blocked_); ++i) |
| 1398 content_blocked_[i] = false; | 1375 content_blocked_[i] = false; |
| 1399 } | 1376 } |
| 1400 | 1377 |
| 1401 // Notifies the RenderWidgetHost instance about the fact that the page is | 1378 // Notifies the RenderWidgetHost instance about the fact that the page is |
| 1402 // loading, or done loading and calls the base implementation. | 1379 // loading, or done loading and calls the base implementation. |
| 1403 void TabContents::SetIsLoading(bool is_loading, | 1380 void TabContents::SetIsLoading(bool is_loading, |
| 1404 LoadNotificationDetails* details) { | 1381 LoadNotificationDetails* details) { |
| (...skipping 1771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3176 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); | 3153 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); |
| 3177 } | 3154 } |
| 3178 | 3155 |
| 3179 Profile* TabContents::GetProfileForPasswordManager() { | 3156 Profile* TabContents::GetProfileForPasswordManager() { |
| 3180 return profile(); | 3157 return profile(); |
| 3181 } | 3158 } |
| 3182 | 3159 |
| 3183 bool TabContents::DidLastPageLoadEncounterSSLErrors() { | 3160 bool TabContents::DidLastPageLoadEncounterSSLErrors() { |
| 3184 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); | 3161 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); |
| 3185 } | 3162 } |
| OLD | NEW |