summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/toolbar_view.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-11 23:53:39 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-11 23:53:39 +0000
commit473a46388fa9b1cc80a5c4eb61e4297c2a1b2210 (patch)
tree195e887b992ceefc01fbaa34f66847b0c85659e4 /chrome/browser/ui/views/toolbar_view.cc
parent41befacda959c08334ed9172b5e8e0d7a6049e7b (diff)
downloadchromium_src-473a46388fa9b1cc80a5c4eb61e4297c2a1b2210.zip
chromium_src-473a46388fa9b1cc80a5c4eb61e4297c2a1b2210.tar.gz
chromium_src-473a46388fa9b1cc80a5c4eb61e4297c2a1b2210.tar.bz2
Some cleanup, mostly for translate icon:
* Make child order match visual order (and make declaration order match too) * Always create the translate icon, and only modify its visibility based on the switch. This matches how other icons behave and is slightly simpler. * Shorten a few other misc. bits BUG=none TEST=none R=hajimehoshi@chromium.org Review URL: https://codereview.chromium.org/61643016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234330 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views/toolbar_view.cc')
-rw-r--r--chrome/browser/ui/views/toolbar_view.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index 063e459..e32759e 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -288,16 +288,13 @@ void ToolbarView::RemoveMenuListener(views::MenuListener* listener) {
views::View* ToolbarView::GetBookmarkBubbleAnchor() {
views::View* star_view = location_bar()->star_view();
- if (star_view && star_view->visible())
- return star_view;
- return app_menu_;
+ return (star_view && star_view->visible()) ? star_view : app_menu_;
}
views::View* ToolbarView::GetTranslateBubbleAnchor() {
views::View* translate_icon_view = location_bar()->translate_icon_view();
- if (translate_icon_view)
- return translate_icon_view;
- return app_menu_;
+ return (translate_icon_view && translate_icon_view->visible()) ?
+ translate_icon_view : app_menu_;
}
views::MenuButton* ToolbarView::app_menu() const {