summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sidebar
diff options
context:
space:
mode:
authoralekseys@chromium.org <alekseys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-25 18:33:26 +0000
committeralekseys@chromium.org <alekseys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-25 18:33:26 +0000
commitfaff269407f885e383ab54b5b94780aa62820201 (patch)
tree9fcb8a8c353c9f600eb90011997eb6c86f434db2 /chrome/browser/sidebar
parentc11efa9c63a5dc3df7c6aa171689fcf6fb202cc0 (diff)
downloadchromium_src-faff269407f885e383ab54b5b94780aa62820201.zip
chromium_src-faff269407f885e383ab54b5b94780aa62820201.tar.gz
chromium_src-faff269407f885e383ab54b5b94780aa62820201.tar.bz2
Only allow extension pages to be displayed in the sidebar to be consistent
with the rest of the extension system. Change extension manifest "sidebar" section and sidebar API accordingly: "sidebar": { "default_icon": "", "default_page": "", "default_title": "" } chrome.experimental.sidebar.navigate({tabId: ..., path: ...}) BUG=51084 TEST=browser_tests::Sidebar.*, unit_tests::ExtensionManifestTest.Sidebar Review URL: http://codereview.chromium.org/6378009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72514 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sidebar')
-rw-r--r--chrome/browser/sidebar/sidebar_container.cc14
-rw-r--r--chrome/browser/sidebar/sidebar_container.h4
2 files changed, 9 insertions, 9 deletions
diff --git a/chrome/browser/sidebar/sidebar_container.cc b/chrome/browser/sidebar/sidebar_container.cc
index a28ef21..4c17dc5 100644
--- a/chrome/browser/sidebar/sidebar_container.cc
+++ b/chrome/browser/sidebar/sidebar_container.cc
@@ -26,7 +26,7 @@ SidebarContainer::SidebarContainer(TabContents* tab,
content_id_(content_id),
delegate_(delegate),
icon_(new SkBitmap),
- navigate_to_default_url_on_expand_(true),
+ navigate_to_default_page_on_expand_(true),
use_default_icon_(true) {
// Create TabContents for sidebar.
sidebar_contents_.reset(
@@ -69,13 +69,13 @@ void SidebarContainer::Show() {
}
void SidebarContainer::Expand() {
- if (navigate_to_default_url_on_expand_) {
- navigate_to_default_url_on_expand_ = false;
- // Check whether a default URL is specified for this sidebar.
+ if (navigate_to_default_page_on_expand_) {
+ navigate_to_default_page_on_expand_ = false;
+ // Check whether a default page is specified for this sidebar.
const Extension* extension = GetExtension();
if (extension) { // Can be NULL in tests.
- if (extension->sidebar_defaults()->default_url().is_valid())
- Navigate(extension->sidebar_defaults()->default_url());
+ if (extension->sidebar_defaults()->default_page().is_valid())
+ Navigate(extension->sidebar_defaults()->default_page());
}
}
@@ -89,7 +89,7 @@ void SidebarContainer::Collapse() {
void SidebarContainer::Navigate(const GURL& url) {
// TODO(alekseys): add a progress UI.
- navigate_to_default_url_on_expand_ = false;
+ navigate_to_default_page_on_expand_ = false;
sidebar_contents_->controller().LoadURL(
url, GURL(), PageTransition::START_PAGE);
}
diff --git a/chrome/browser/sidebar/sidebar_container.h b/chrome/browser/sidebar/sidebar_container.h
index bcd5cfd..2436c10 100644
--- a/chrome/browser/sidebar/sidebar_container.h
+++ b/chrome/browser/sidebar/sidebar_container.h
@@ -147,10 +147,10 @@ class SidebarContainer
string16 title_;
// On the first expand sidebar will be automatically navigated to the default
- // url (specified in the extension manifest), but only if the extension has
+ // page (specified in the extension manifest), but only if the extension has
// not explicitly navigated it yet. This variable is set to false on the first
// sidebar navigation.
- bool navigate_to_default_url_on_expand_;
+ bool navigate_to_default_page_on_expand_;
// Since the default icon (specified in the extension manifest) is loaded
// asynchronously, sidebar icon can already be set by the extension
// by the time it's loaded. This variable tracks whether the loaded default