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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc

Issue 7057014: Variety of tweaks to View API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
===================================================================
--- chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc (revision 86083)
+++ chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc (working copy)
@@ -360,7 +360,7 @@
sync_service_->AddObserver(this);
}
- SetID(VIEW_ID_BOOKMARK_BAR);
+ set_id(VIEW_ID_BOOKMARK_BAR);
Init();
SetProfile(profile);
@@ -503,7 +503,7 @@
} else {
x = GetBookmarkButton(index)->x();
}
- if (GetBookmarkButtonCount() > 0 && GetBookmarkButton(0)->IsVisible()) {
+ if (GetBookmarkButtonCount() > 0 && GetBookmarkButton(0)->visible()) {
y = GetBookmarkButton(0)->y();
h = GetBookmarkButton(0)->height();
}
@@ -794,21 +794,21 @@
// Check the buttons first.
for (int i = 0; i < GetBookmarkButtonCount(); ++i) {
views::View* child = GetChildViewAt(i);
- if (!child->IsVisible())
+ if (!child->visible())
break;
if (child->bounds().Contains(adjusted_loc))
return model_->GetBookmarkBarNode()->GetChild(i);
}
// Then the overflow button.
- if (overflow_button_->IsVisible() &&
+ if (overflow_button_->visible() &&
overflow_button_->bounds().Contains(adjusted_loc)) {
*start_index = GetFirstHiddenNodeIndex();
return model_->GetBookmarkBarNode();
}
// And finally the other folder.
- if (other_bookmarked_button_->IsVisible() &&
+ if (other_bookmarked_button_->visible() &&
other_bookmarked_button_->bounds().Contains(adjusted_loc)) {
return model_->other_node();
}
@@ -894,7 +894,7 @@
UTF16ToWide(l10n_util::GetStringUTF16(IDS_BOOMARK_BAR_OTHER_BOOKMARKED)),
this,
false);
- button->SetID(VIEW_ID_OTHER_BOOKMARKS);
+ button->set_id(VIEW_ID_OTHER_BOOKMARKS);
button->SetIcon(GetFolderIcon());
button->SetContextMenuController(this);
button->set_tag(kOtherFolderButtonTag);
@@ -1047,7 +1047,7 @@
if (old_pref.width() != new_pref.width()) {
Layout();
SchedulePaint();
- } else if (button->IsVisible()) {
+ } else if (button->visible()) {
button->SchedulePaint();
}
}
@@ -1261,7 +1261,7 @@
views::TextButton* button) {
button->SetText(UTF16ToWide(node->GetTitle()));
button->SetAccessibleName(node->GetTitle());
- button->SetID(VIEW_ID_BOOKMARK_BAR_ELEMENT);
+ button->set_id(VIEW_ID_BOOKMARK_BAR_ELEMENT);
// We don't always have a theme provider (ui tests, for example).
if (GetThemeProvider()) {
button->SetEnabledColor(GetThemeProvider()->GetColor(
@@ -1396,7 +1396,7 @@
bool found = false;
const int other_delta_x = mirrored_x - other_bookmarked_button_->x();
- if (other_bookmarked_button_->IsVisible() && other_delta_x >= 0 &&
+ if (other_bookmarked_button_->visible() && other_delta_x >= 0 &&
other_delta_x < other_bookmarked_button_->width()) {
// Mouse is over 'other' folder.
*is_over_other = true;
@@ -1413,7 +1413,7 @@
}
for (int i = 0; i < GetBookmarkButtonCount() &&
- GetBookmarkButton(i)->IsVisible() && !found; i++) {
+ GetBookmarkButton(i)->visible() && !found; i++) {
views::TextButton* button = GetBookmarkButton(i);
int button_x = mirrored_x - button->x();
int button_w = button->width();
@@ -1439,7 +1439,7 @@
}
if (!found) {
- if (overflow_button_->IsVisible()) {
+ if (overflow_button_->visible()) {
// Are we over the overflow button?
int overflow_delta_x = mirrored_x - overflow_button_->x();
if (overflow_delta_x >= 0 &&
@@ -1454,7 +1454,7 @@
} else {
return ui::DragDropTypes::DRAG_NONE;
}
- } else if (!other_bookmarked_button_->IsVisible() ||
+ } else if (!other_bookmarked_button_->visible() ||
mirrored_x < other_bookmarked_button_->x()) {
// Mouse is after the last visible button but before more recently
// bookmarked; use the last visible index.
@@ -1487,7 +1487,7 @@
int BookmarkBarView::GetFirstHiddenNodeIndex() {
const int bb_count = GetBookmarkButtonCount();
for (int i = 0; i < bb_count; ++i) {
- if (!GetBookmarkButton(i)->IsVisible())
+ if (!GetBookmarkButton(i)->visible())
return i;
}
return bb_count;
@@ -1617,7 +1617,7 @@
void BookmarkBarView::UpdateOtherBookmarksVisibility() {
bool has_other_children = model_->other_node()->child_count() > 0;
- if (has_other_children == other_bookmarked_button_->IsVisible())
+ if (has_other_children == other_bookmarked_button_->visible())
return;
other_bookmarked_button_->SetVisible(has_other_children);
bookmarks_separator_view_->SetVisible(has_other_children);
@@ -1654,7 +1654,7 @@
}
gfx::Size other_bookmarked_pref =
- other_bookmarked_button_->IsVisible() ?
+ other_bookmarked_button_->visible() ?
other_bookmarked_button_->GetPreferredSize() : gfx::Size();
gfx::Size overflow_pref = overflow_button_->GetPreferredSize();
gfx::Size bookmarks_separator_pref =
@@ -1667,7 +1667,7 @@
}
int max_x = width - overflow_pref.width() - kButtonPadding -
bookmarks_separator_pref.width() - sync_error_total_width;
- if (other_bookmarked_button_->IsVisible())
+ if (other_bookmarked_button_->visible())
max_x -= other_bookmarked_pref.width() + kButtonPadding;
// Next, layout out the buttons. Any buttons that are placed beyond the
@@ -1701,7 +1701,7 @@
// Layout the right side of the bar.
const bool all_visible =
(GetBookmarkButtonCount() == 0 ||
- GetChildViewAt(GetBookmarkButtonCount() - 1)->IsVisible());
+ GetChildViewAt(GetBookmarkButtonCount() - 1)->visible());
// Layout the right side buttons.
if (!compute_bounds_only)
@@ -1717,7 +1717,7 @@
x += overflow_pref.width();
// Separator.
- if (bookmarks_separator_view_->IsVisible()) {
+ if (bookmarks_separator_view_->visible()) {
if (!compute_bounds_only) {
bookmarks_separator_view_->SetBounds(x,
y - top_margin,
@@ -1730,7 +1730,7 @@
}
// The other bookmarks button.
- if (other_bookmarked_button_->IsVisible()) {
+ if (other_bookmarked_button_->visible()) {
if (!compute_bounds_only) {
other_bookmarked_button_->SetBounds(x, y, other_bookmarked_pref.width(),
height);

Powered by Google App Engine
This is Rietveld 408576698