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_plugin_manager.h" | 24 #include "chrome/browser/blocked_plugin_manager.h" |
25 #include "chrome/browser/blocked_popup_container.h" | 25 #include "chrome/browser/blocked_popup_container.h" |
26 #include "chrome/browser/bookmarks/bookmark_model.h" | 26 #include "chrome/browser/bookmarks/bookmark_model.h" |
27 #include "chrome/browser/browser.h" | |
28 #include "chrome/browser/browser_process.h" | 27 #include "chrome/browser/browser_process.h" |
29 #include "chrome/browser/browser_shutdown.h" | 28 #include "chrome/browser/browser_shutdown.h" |
30 #include "chrome/browser/cert_store.h" | 29 #include "chrome/browser/cert_store.h" |
31 #include "chrome/browser/character_encoding.h" | 30 #include "chrome/browser/character_encoding.h" |
32 #include "chrome/browser/debugger/devtools_manager.h" | 31 #include "chrome/browser/debugger/devtools_manager.h" |
33 #include "chrome/browser/dom_operation_notification_details.h" | 32 #include "chrome/browser/dom_operation_notification_details.h" |
34 #include "chrome/browser/dom_ui/dom_ui.h" | 33 #include "chrome/browser/dom_ui/dom_ui.h" |
35 #include "chrome/browser/dom_ui/dom_ui_factory.h" | 34 #include "chrome/browser/dom_ui/dom_ui_factory.h" |
36 #include "chrome/browser/download/download_item_model.h" | 35 #include "chrome/browser/download/download_item_model.h" |
37 #include "chrome/browser/download/download_manager.h" | 36 #include "chrome/browser/download/download_manager.h" |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 ExtensionsService* extension_service = profile()->GetExtensionsService(); | 603 ExtensionsService* extension_service = profile()->GetExtensionsService(); |
605 if (extension_service && extension_service->is_ready()) { | 604 if (extension_service && extension_service->is_ready()) { |
606 Extension* extension = | 605 Extension* extension = |
607 extension_service->GetExtensionById(extension_app_id, false); | 606 extension_service->GetExtensionById(extension_app_id, false); |
608 if (extension) | 607 if (extension) |
609 SetExtensionApp(extension); | 608 SetExtensionApp(extension); |
610 } | 609 } |
611 } | 610 } |
612 | 611 |
613 SkBitmap* TabContents::GetExtensionAppIcon() { | 612 SkBitmap* TabContents::GetExtensionAppIcon() { |
614 // We don't show the big icons in tabs for TYPE_EXTENSION_APP windows because | |
615 // for those windows, we already have a big icon in the top-left outside any | |
616 // tab. Having big tab icons too looks kinda redonk. | |
617 Browser* browser = delegate_ ? delegate_->GetBrowser() : NULL; | |
618 if (browser && browser->type() == Browser::TYPE_EXTENSION_APP) | |
619 return NULL; | |
620 | |
621 if (extension_app_icon_.empty()) | 613 if (extension_app_icon_.empty()) |
622 return NULL; | 614 return NULL; |
623 | 615 |
624 return &extension_app_icon_; | 616 return &extension_app_icon_; |
625 } | 617 } |
626 | 618 |
627 const GURL& TabContents::GetURL() const { | 619 const GURL& TabContents::GetURL() const { |
628 // We may not have a navigation entry yet | 620 // We may not have a navigation entry yet |
629 NavigationEntry* entry = controller_.GetActiveEntry(); | 621 NavigationEntry* entry = controller_.GetActiveEntry(); |
630 return entry ? entry->virtual_url() : GURL::EmptyGURL(); | 622 return entry ? entry->virtual_url() : GURL::EmptyGURL(); |
(...skipping 2702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3333 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); | 3325 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); |
3334 } | 3326 } |
3335 | 3327 |
3336 Profile* TabContents::GetProfileForPasswordManager() { | 3328 Profile* TabContents::GetProfileForPasswordManager() { |
3337 return profile(); | 3329 return profile(); |
3338 } | 3330 } |
3339 | 3331 |
3340 bool TabContents::DidLastPageLoadEncounterSSLErrors() { | 3332 bool TabContents::DidLastPageLoadEncounterSSLErrors() { |
3341 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); | 3333 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); |
3342 } | 3334 } |
OLD | NEW |