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" | |
27 #include "chrome/browser/browser_process.h" | 26 #include "chrome/browser/browser_process.h" |
28 #include "chrome/browser/browser_shutdown.h" | 27 #include "chrome/browser/browser_shutdown.h" |
29 #include "chrome/browser/cert_store.h" | 28 #include "chrome/browser/cert_store.h" |
30 #include "chrome/browser/character_encoding.h" | 29 #include "chrome/browser/character_encoding.h" |
31 #include "chrome/browser/debugger/devtools_manager.h" | 30 #include "chrome/browser/debugger/devtools_manager.h" |
32 #include "chrome/browser/dom_operation_notification_details.h" | 31 #include "chrome/browser/dom_operation_notification_details.h" |
33 #include "chrome/browser/dom_ui/dom_ui.h" | 32 #include "chrome/browser/dom_ui/dom_ui.h" |
34 #include "chrome/browser/dom_ui/dom_ui_factory.h" | 33 #include "chrome/browser/dom_ui/dom_ui_factory.h" |
35 #include "chrome/browser/download/download_item_model.h" | 34 #include "chrome/browser/download/download_item_model.h" |
36 #include "chrome/browser/download/download_manager.h" | 35 #include "chrome/browser/download/download_manager.h" |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 ExtensionsService* extension_service = profile()->GetExtensionsService(); | 531 ExtensionsService* extension_service = profile()->GetExtensionsService(); |
533 if (extension_service && extension_service->is_ready()) { | 532 if (extension_service && extension_service->is_ready()) { |
534 Extension* extension = | 533 Extension* extension = |
535 extension_service->GetExtensionById(extension_app_id, false); | 534 extension_service->GetExtensionById(extension_app_id, false); |
536 if (extension) | 535 if (extension) |
537 SetExtensionApp(extension); | 536 SetExtensionApp(extension); |
538 } | 537 } |
539 } | 538 } |
540 | 539 |
541 SkBitmap* TabContents::GetExtensionAppIcon() { | 540 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 | |
549 if (extension_app_icon_.empty()) | 541 if (extension_app_icon_.empty()) |
550 return NULL; | 542 return NULL; |
551 | 543 |
552 return &extension_app_icon_; | 544 return &extension_app_icon_; |
553 } | 545 } |
554 | 546 |
555 const GURL& TabContents::GetURL() const { | 547 const GURL& TabContents::GetURL() const { |
556 // We may not have a navigation entry yet | 548 // We may not have a navigation entry yet |
557 NavigationEntry* entry = controller_.GetActiveEntry(); | 549 NavigationEntry* entry = controller_.GetActiveEntry(); |
558 return entry ? entry->virtual_url() : GURL::EmptyGURL(); | 550 return entry ? entry->virtual_url() : GURL::EmptyGURL(); |
(...skipping 2701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3260 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); | 3252 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); |
3261 } | 3253 } |
3262 | 3254 |
3263 Profile* TabContents::GetProfileForPasswordManager() { | 3255 Profile* TabContents::GetProfileForPasswordManager() { |
3264 return profile(); | 3256 return profile(); |
3265 } | 3257 } |
3266 | 3258 |
3267 bool TabContents::DidLastPageLoadEncounterSSLErrors() { | 3259 bool TabContents::DidLastPageLoadEncounterSSLErrors() { |
3268 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); | 3260 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); |
3269 } | 3261 } |
OLD | NEW |