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) |
11 | 11 |
12 #include "app/l10n_util.h" | 12 #include "app/l10n_util.h" |
13 #include "app/resource_bundle.h" | 13 #include "app/resource_bundle.h" |
14 #include "app/text_elider.h" | 14 #include "app/text_elider.h" |
15 #include "base/auto_reset.h" | 15 #include "base/auto_reset.h" |
16 #include "base/file_version_info.h" | 16 #include "base/file_version_info.h" |
17 #include "base/i18n/rtl.h" | 17 #include "base/i18n/rtl.h" |
18 #include "base/process_util.h" | 18 #include "base/process_util.h" |
19 #include "base/string16.h" | 19 #include "base/string16.h" |
20 #include "base/string_util.h" | 20 #include "base/string_util.h" |
21 #include "base/time.h" | 21 #include "base/time.h" |
22 #include "chrome/browser/autocomplete_history_manager.h" | 22 #include "chrome/browser/autocomplete_history_manager.h" |
23 #include "chrome/browser/autofill/autofill_manager.h" | 23 #include "chrome/browser/autofill/autofill_manager.h" |
24 #include "chrome/browser/blocked_popup_container.h" | 24 #include "chrome/browser/blocked_popup_container.h" |
25 #include "chrome/browser/bookmarks/bookmark_model.h" | 25 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 26 #include "chrome/browser/browser.h" |
26 #include "chrome/browser/browser_process.h" | 27 #include "chrome/browser/browser_process.h" |
27 #include "chrome/browser/browser_shutdown.h" | 28 #include "chrome/browser/browser_shutdown.h" |
28 #include "chrome/browser/cert_store.h" | 29 #include "chrome/browser/cert_store.h" |
29 #include "chrome/browser/character_encoding.h" | 30 #include "chrome/browser/character_encoding.h" |
30 #include "chrome/browser/debugger/devtools_manager.h" | 31 #include "chrome/browser/debugger/devtools_manager.h" |
31 #include "chrome/browser/dom_operation_notification_details.h" | 32 #include "chrome/browser/dom_operation_notification_details.h" |
32 #include "chrome/browser/dom_ui/dom_ui.h" | 33 #include "chrome/browser/dom_ui/dom_ui.h" |
33 #include "chrome/browser/dom_ui/dom_ui_factory.h" | 34 #include "chrome/browser/dom_ui/dom_ui_factory.h" |
34 #include "chrome/browser/download/download_item_model.h" | 35 #include "chrome/browser/download/download_item_model.h" |
35 #include "chrome/browser/download/download_manager.h" | 36 #include "chrome/browser/download/download_manager.h" |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 ExtensionsService* extension_service = profile()->GetExtensionsService(); | 532 ExtensionsService* extension_service = profile()->GetExtensionsService(); |
532 if (extension_service && extension_service->is_ready()) { | 533 if (extension_service && extension_service->is_ready()) { |
533 Extension* extension = | 534 Extension* extension = |
534 extension_service->GetExtensionById(extension_app_id, false); | 535 extension_service->GetExtensionById(extension_app_id, false); |
535 if (extension) | 536 if (extension) |
536 SetExtensionApp(extension); | 537 SetExtensionApp(extension); |
537 } | 538 } |
538 } | 539 } |
539 | 540 |
540 SkBitmap* TabContents::GetExtensionAppIcon() { | 541 SkBitmap* TabContents::GetExtensionAppIcon() { |
| 542 // We don't show the big icons in tabs for TYPE_EXTENSION_APP windows because |
| 543 // for those windows, we already have a big icon in the top-left outside any |
| 544 // tab. Having big tab icons too looks kinda redonk. |
| 545 Browser* browser = delegate_ ? delegate_->GetBrowser() : NULL; |
| 546 if (browser && browser->type() == Browser::TYPE_EXTENSION_APP) |
| 547 return NULL; |
| 548 |
541 if (extension_app_icon_.empty()) | 549 if (extension_app_icon_.empty()) |
542 return NULL; | 550 return NULL; |
543 | 551 |
544 return &extension_app_icon_; | 552 return &extension_app_icon_; |
545 } | 553 } |
546 | 554 |
547 const GURL& TabContents::GetURL() const { | 555 const GURL& TabContents::GetURL() const { |
548 // We may not have a navigation entry yet | 556 // We may not have a navigation entry yet |
549 NavigationEntry* entry = controller_.GetActiveEntry(); | 557 NavigationEntry* entry = controller_.GetActiveEntry(); |
550 return entry ? entry->virtual_url() : GURL::EmptyGURL(); | 558 return entry ? entry->virtual_url() : GURL::EmptyGURL(); |
(...skipping 2701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3252 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); | 3260 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); |
3253 } | 3261 } |
3254 | 3262 |
3255 Profile* TabContents::GetProfileForPasswordManager() { | 3263 Profile* TabContents::GetProfileForPasswordManager() { |
3256 return profile(); | 3264 return profile(); |
3257 } | 3265 } |
3258 | 3266 |
3259 bool TabContents::DidLastPageLoadEncounterSSLErrors() { | 3267 bool TabContents::DidLastPageLoadEncounterSSLErrors() { |
3260 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); | 3268 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); |
3261 } | 3269 } |
OLD | NEW |