Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Issue 7327010: Makes the bookmark menu show a separator before other bookmarks. (Closed)

Created:
9 years, 5 months ago by sky
Modified:
9 years, 5 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Makes the bookmark menu show a separator before other bookmarks. BUG=85980 TEST=make sure bookmark menu on windows has a separator before 'other bookmarks'. R=ben@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=91804

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -2 lines) Patch
M chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc View 2 chunks +14 lines, -2 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
sky
9 years, 5 months ago (2011-07-07 21:43:05 UTC) #1
Ben Goodger (Google)
9 years, 5 months ago (2011-07-07 21:47:44 UTC) #2
LGTM

On Thu, Jul 7, 2011 at 2:43 PM, <sky@chromium.org> wrote:

> Reviewers: Ben Goodger (Google),
>
> Description:
> Makes the bookmark menu show a separator before other bookmarks.
>
> BUG=85980
> TEST=make sure bookmark menu on windows has a separator before 'other
> bookmarks'.
> R=ben@chromium.org
>
>
> Please review this at
http://codereview.chromium.**org/7327010/<http://codereview.chromium.org/7327...
>
> SVN Base:
svn://svn.chromium.org/chrome/**trunk/src<http://svn.chromium.org/chrome/trunk/src>
>
> Affected files:
>  M chrome/browser/ui/views/**bookmarks/bookmark_menu_**delegate.cc
>
>
> Index: chrome/browser/ui/views/**bookmarks/bookmark_menu_**delegate.cc
> diff --git a/chrome/browser/ui/views/**bookmarks/bookmark_menu_**delegate.cc
> b/chrome/browser/ui/views/**bookmarks/bookmark_menu_**delegate.cc
> index 14217002861123a07016b24fe64137**e093cc5cb4..**
> 6a178f2c0a4e49cd545bb6f0900878**70673b2898 100644
> --- a/chrome/browser/ui/views/**bookmarks/bookmark_menu_**delegate.cc
> +++ b/chrome/browser/ui/views/**bookmarks/bookmark_menu_**delegate.cc
> @@ -25,6 +25,7 @@
>  #include "ui/base/resource/resource_**bundle.h"
>  #include "views/controls/button/menu_**button.h"
>  #include "views/controls/menu/menu_**item_view.h"
> +#include "views/controls/menu/submenu_**view.h"
>
>  using views::MenuItemView;
>
> @@ -61,9 +62,20 @@ void BookmarkMenuDelegate::Init(**views::MenuDelegate*
> real_delegate,
>   real_delegate_ = real_delegate;
>   if (parent) {
>     parent_menu_item_ = parent;
> +    int initial_count = parent->GetSubmenu() ?
> +        parent->GetSubmenu()->**GetMenuItemCount() : 0;
>     BuildMenu(node, start_child_index, parent, &next_menu_id_);
> -    if (show_options == SHOW_OTHER_FOLDER)
> -      BuildOtherFolderMenu(parent, &next_menu_id_);
> +    if (show_options == SHOW_OTHER_FOLDER) {
> +      const BookmarkNode* other_folder =
> +          profile_->GetBookmarkModel()->**other_node();
> +      if (other_folder->child_count() > 0) {
> +        int current_count = parent->GetSubmenu() ?
> +            parent->GetSubmenu()->**GetMenuItemCount() : 0;
> +        if (current_count != initial_count)
> +          parent->AppendSeparator();
> +        BuildOtherFolderMenu(parent, &next_menu_id_);
> +      }
> +    }
>   } else {
>     menu_ = CreateMenu(node, start_child_index, show_options);
>   }
>
>
>

Powered by Google App Engine
This is Rietveld 408576698