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 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 NotificationType::TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED, | 591 NotificationType::TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED, |
592 Source<TabContents>(this), | 592 Source<TabContents>(this), |
593 NotificationService::NoDetails()); | 593 NotificationService::NoDetails()); |
594 } | 594 } |
595 | 595 |
596 void TabContents::SetExtensionAppById(const std::string& extension_app_id) { | 596 void TabContents::SetExtensionAppById(const std::string& extension_app_id) { |
597 if (extension_app_id.empty()) | 597 if (extension_app_id.empty()) |
598 return; | 598 return; |
599 | 599 |
600 ExtensionsService* extension_service = profile()->GetExtensionsService(); | 600 ExtensionsService* extension_service = profile()->GetExtensionsService(); |
601 if (extension_service && extension_service->is_ready()) { | 601 if (!extension_service || !extension_service->is_ready()) |
602 const Extension* extension = | 602 return; |
603 extension_service->GetExtensionById(extension_app_id, false); | 603 |
604 if (extension) | 604 const Extension* extension = |
605 SetExtensionApp(extension); | 605 extension_service->GetExtensionById(extension_app_id, false); |
606 } | 606 if (extension) |
| 607 SetExtensionApp(extension); |
607 } | 608 } |
608 | 609 |
609 SkBitmap* TabContents::GetExtensionAppIcon() { | 610 SkBitmap* TabContents::GetExtensionAppIcon() { |
610 if (extension_app_icon_.empty()) | 611 if (extension_app_icon_.empty()) |
611 return NULL; | 612 return NULL; |
612 | 613 |
613 return &extension_app_icon_; | 614 return &extension_app_icon_; |
614 } | 615 } |
615 | 616 |
616 const GURL& TabContents::GetURL() const { | 617 const GURL& TabContents::GetURL() const { |
(...skipping 2599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3216 } | 3217 } |
3217 | 3218 |
3218 void TabContents::set_encoding(const std::string& encoding) { | 3219 void TabContents::set_encoding(const std::string& encoding) { |
3219 encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding); | 3220 encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding); |
3220 } | 3221 } |
3221 | 3222 |
3222 void TabContents::SetAppIcon(const SkBitmap& app_icon) { | 3223 void TabContents::SetAppIcon(const SkBitmap& app_icon) { |
3223 app_icon_ = app_icon; | 3224 app_icon_ = app_icon; |
3224 NotifyNavigationStateChanged(INVALIDATE_TITLE); | 3225 NotifyNavigationStateChanged(INVALIDATE_TITLE); |
3225 } | 3226 } |
OLD | NEW |