| 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(), PageTransition::START_PAGE, std::string()); | 93 url, GURL(), content::PAGE_TRANSITION_START_PAGE, std::string()); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void SidebarContainer::SetBadgeText(const string16& badge_text) { | 96 void SidebarContainer::SetBadgeText(const string16& badge_text) { |
| 97 badge_text_ = badge_text; | 97 badge_text_ = badge_text; |
| 98 } | 98 } |
| 99 | 99 |
| 100 void SidebarContainer::SetIcon(const SkBitmap& bitmap) { | 100 void SidebarContainer::SetIcon(const SkBitmap& bitmap) { |
| 101 use_default_icon_ = false; | 101 use_default_icon_ = false; |
| 102 *icon_ = bitmap; | 102 *icon_ = bitmap; |
| 103 } | 103 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 126 | 126 |
| 127 const Extension* SidebarContainer::GetExtension() const { | 127 const Extension* SidebarContainer::GetExtension() const { |
| 128 Profile* profile = | 128 Profile* profile = |
| 129 Profile::FromBrowserContext(sidebar_contents_->browser_context()); | 129 Profile::FromBrowserContext(sidebar_contents_->browser_context()); |
| 130 ExtensionService* service = profile->GetExtensionService(); | 130 ExtensionService* service = profile->GetExtensionService(); |
| 131 if (!service) | 131 if (!service) |
| 132 return NULL; | 132 return NULL; |
| 133 return service->GetExtensionById( | 133 return service->GetExtensionById( |
| 134 extension_sidebar_utils::GetExtensionIdByContentId(content_id_), false); | 134 extension_sidebar_utils::GetExtensionIdByContentId(content_id_), false); |
| 135 } | 135 } |
| OLD | NEW |