summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-19 22:24:26 +0000
committerjoaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-19 22:24:26 +0000
commit0d897c0d674e8e9b04cf803827bb4224ed9674b3 (patch)
tree24c6de21efa1d4c713332b9992769bb66db2991e
parent24df1c41d3bdc2c1cf05ee64f190c0e56df88046 (diff)
downloadchromium_src-0d897c0d674e8e9b04cf803827bb4224ed9674b3.zip
chromium_src-0d897c0d674e8e9b04cf803827bb4224ed9674b3.tar.gz
chromium_src-0d897c0d674e8e9b04cf803827bb4224ed9674b3.tar.bz2
Use the managed bookmarks icon for its folder in views.
BUG=379862 Review URL: https://codereview.chromium.org/328363003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278507 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/theme/theme_resources.grd1
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc9
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc16
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h1
4 files changed, 15 insertions, 12 deletions
diff --git a/chrome/app/theme/theme_resources.grd b/chrome/app/theme/theme_resources.grd
index b08f69c..4e9f8db 100644
--- a/chrome/app/theme/theme_resources.grd
+++ b/chrome/app/theme/theme_resources.grd
@@ -126,6 +126,7 @@
</if>
<if expr="not is_macosx and not is_ios">
<structure type="chrome_scaled_image" name="IDR_BOOKMARK_BAR_FOLDER" file="common/bookmark_bar_folder.png" />
+ <structure type="chrome_scaled_image" name="IDR_BOOKMARK_BAR_FOLDER_MANAGED" file="common/bookmark_bar_folder_managed.png" />
</if>
<structure type="chrome_scaled_image" name="IDR_BOOKMARK_BAR_APPS_SHORTCUT" file="common/apps_bookmark_bar_icon.png" />
<if expr="chromeos">
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index f9d0012..de90b97 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -1335,7 +1335,7 @@ void BookmarkBarView::Init() {
other_bookmarked_button_->SetEnabled(false);
AddChildView(other_bookmarked_button_);
- managed_bookmarks_button_ = CreateOtherBookmarkedButton();
+ managed_bookmarks_button_ = CreateManagedBookmarksButton();
// Also re-enabled when the model is loaded.
managed_bookmarks_button_->SetEnabled(false);
AddChildView(managed_bookmarks_button_);
@@ -1419,9 +1419,10 @@ MenuButton* BookmarkBarView::CreateManagedBookmarksButton() {
MenuButton* button =
new BookmarkFolderButton(this, base::string16(), this, false);
button->set_id(VIEW_ID_MANAGED_BOOKMARKS);
- // TODO(joaodasilva): replace with a "managed folder" icon.
- // http://crbug.com/49598
- button->SetImage(views::Button::STATE_NORMAL, GetFolderIcon());
+ ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
+ gfx::ImageSkia* image =
+ rb->GetImageSkiaNamed(IDR_BOOKMARK_BAR_FOLDER_MANAGED);
+ button->SetImage(views::Button::STATE_NORMAL, *image);
button->set_context_menu_controller(this);
button->set_tag(kManagedFolderButtonTag);
return button;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
index d3a20fc..139434f 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
@@ -441,14 +441,15 @@ void BookmarkMenuDelegate::BuildMenusForPermanentNodes(
int* next_menu_id) {
BookmarkModel* model = GetBookmarkModel();
bool added_separator = false;
- BuildMenuForPermanentNode(model->other_node(), menu, next_menu_id,
- &added_separator);
- BuildMenuForPermanentNode(model->mobile_node(), menu, next_menu_id,
- &added_separator);
+ BuildMenuForPermanentNode(model->other_node(), IDR_BOOKMARK_BAR_FOLDER, menu,
+ next_menu_id, &added_separator);
+ BuildMenuForPermanentNode(model->mobile_node(), IDR_BOOKMARK_BAR_FOLDER, menu,
+ next_menu_id, &added_separator);
}
void BookmarkMenuDelegate::BuildMenuForPermanentNode(
const BookmarkNode* node,
+ int icon_resource_id,
MenuItemView* menu,
int* next_menu_id,
bool* added_separator) {
@@ -467,7 +468,7 @@ void BookmarkMenuDelegate::BuildMenuForPermanentNode(
}
ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
- gfx::ImageSkia* folder_icon = rb->GetImageSkiaNamed(IDR_BOOKMARK_BAR_FOLDER);
+ gfx::ImageSkia* folder_icon = rb->GetImageSkiaNamed(icon_resource_id);
MenuItemView* submenu = menu->AppendSubMenuWithIcon(
id, node->GetTitle(), *folder_icon);
BuildMenu(node, 0, submenu, next_menu_id);
@@ -480,9 +481,8 @@ void BookmarkMenuDelegate::BuildMenuForManagedNode(
// Don't add a separator for this menu.
bool added_separator = true;
const BookmarkNode* node = GetChromeBookmarkClient()->managed_node();
- // TODO(joaodasilva): use the "managed bookmark folder" icon here.
- // http://crbug.com/49598
- BuildMenuForPermanentNode(node, menu, next_menu_id, &added_separator);
+ BuildMenuForPermanentNode(node, IDR_BOOKMARK_BAR_FOLDER_MANAGED, menu,
+ next_menu_id, &added_separator);
}
void BookmarkMenuDelegate::BuildMenu(const BookmarkNode* parent,
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h
index 609531d..ddfd2ba 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h
@@ -150,6 +150,7 @@ class BookmarkMenuDelegate : public BaseBookmarkModelObserver,
// separator is added before the new menu items and |added_separator| is set
// to true.
void BuildMenuForPermanentNode(const BookmarkNode* node,
+ int icon_resource_id,
views::MenuItemView* menu,
int* next_menu_id,
bool* added_separator);