| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/sidebar/sidebar_container.h" | 5 #include "chrome/browser/sidebar/sidebar_container.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" | 9 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" |
| 10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 | 84 |
| 85 void SidebarContainer::Collapse() { | 85 void SidebarContainer::Collapse() { |
| 86 delegate_->UpdateSidebar(this); | 86 delegate_->UpdateSidebar(this); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void SidebarContainer::Navigate(const GURL& url) { | 89 void SidebarContainer::Navigate(const GURL& url) { |
| 90 // TODO(alekseys): add a progress UI. | 90 // TODO(alekseys): add a progress UI. |
| 91 navigate_to_default_page_on_expand_ = false; | 91 navigate_to_default_page_on_expand_ = false; |
| 92 sidebar_contents_->controller().LoadURL( | 92 sidebar_contents_->controller().LoadURL( |
| 93 url, GURL(), content::PAGE_TRANSITION_START_PAGE, std::string()); | 93 url, content::Referrer(), content::PAGE_TRANSITION_START_PAGE, |
| 94 std::string()); |
| 94 } | 95 } |
| 95 | 96 |
| 96 void SidebarContainer::SetBadgeText(const string16& badge_text) { | 97 void SidebarContainer::SetBadgeText(const string16& badge_text) { |
| 97 badge_text_ = badge_text; | 98 badge_text_ = badge_text; |
| 98 } | 99 } |
| 99 | 100 |
| 100 void SidebarContainer::SetIcon(const SkBitmap& bitmap) { | 101 void SidebarContainer::SetIcon(const SkBitmap& bitmap) { |
| 101 use_default_icon_ = false; | 102 use_default_icon_ = false; |
| 102 *icon_ = bitmap; | 103 *icon_ = bitmap; |
| 103 } | 104 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 122 | 123 |
| 123 const Extension* SidebarContainer::GetExtension() const { | 124 const Extension* SidebarContainer::GetExtension() const { |
| 124 Profile* profile = | 125 Profile* profile = |
| 125 Profile::FromBrowserContext(sidebar_contents_->browser_context()); | 126 Profile::FromBrowserContext(sidebar_contents_->browser_context()); |
| 126 ExtensionService* service = profile->GetExtensionService(); | 127 ExtensionService* service = profile->GetExtensionService(); |
| 127 if (!service) | 128 if (!service) |
| 128 return NULL; | 129 return NULL; |
| 129 return service->GetExtensionById( | 130 return service->GetExtensionById( |
| 130 extension_sidebar_utils::GetExtensionIdByContentId(content_id_), false); | 131 extension_sidebar_utils::GetExtensionIdByContentId(content_id_), false); |
| 131 } | 132 } |
| OLD | NEW |