OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1170 bookmark_menu_->set_observer(this); | 1170 bookmark_menu_->set_observer(this); |
1171 bookmark_menu_->RunMenuAt(this, false); | 1171 bookmark_menu_->RunMenuAt(this, false); |
1172 } | 1172 } |
1173 | 1173 |
1174 void BookmarkBarView::ButtonPressed(views::Button* sender, | 1174 void BookmarkBarView::ButtonPressed(views::Button* sender, |
1175 const views::Event& event) { | 1175 const views::Event& event) { |
1176 // Show the login wizard if the user clicked the re-login button. | 1176 // Show the login wizard if the user clicked the re-login button. |
1177 if (sender->tag() == kSyncErrorButtonTag) { | 1177 if (sender->tag() == kSyncErrorButtonTag) { |
1178 DCHECK(sender == sync_error_button_); | 1178 DCHECK(sender == sync_error_button_); |
1179 DCHECK(sync_service_ && !sync_service_->IsManaged()); | 1179 DCHECK(sync_service_ && !sync_service_->IsManaged()); |
1180 sync_service_->ShowErrorUI(); | 1180 sync_service_->ShowErrorUI(NULL); |
1181 return; | 1181 return; |
1182 } | 1182 } |
1183 | 1183 |
1184 const BookmarkNode* node; | 1184 const BookmarkNode* node; |
1185 if (sender->tag() == kOtherFolderButtonTag) { | 1185 if (sender->tag() == kOtherFolderButtonTag) { |
1186 node = model_->other_node(); | 1186 node = model_->other_node(); |
1187 } else { | 1187 } else { |
1188 int index = GetIndexOf(sender); | 1188 int index = GetIndexOf(sender); |
1189 DCHECK_NE(-1, index); | 1189 DCHECK_NE(-1, index); |
1190 node = model_->GetBookmarkBarNode()->GetChild(index); | 1190 node = model_->GetBookmarkBarNode()->GetChild(index); |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1780 // The tooltip is the only way we have to display text explaining the error | 1780 // The tooltip is the only way we have to display text explaining the error |
1781 // to the user. | 1781 // to the user. |
1782 sync_error_button->SetTooltipText( | 1782 sync_error_button->SetTooltipText( |
1783 UTF16ToWide(l10n_util::GetStringUTF16(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC))); | 1783 UTF16ToWide(l10n_util::GetStringUTF16(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC))); |
1784 sync_error_button->SetAccessibleName( | 1784 sync_error_button->SetAccessibleName( |
1785 l10n_util::GetStringUTF16(IDS_ACCNAME_SYNC_ERROR_BUTTON)); | 1785 l10n_util::GetStringUTF16(IDS_ACCNAME_SYNC_ERROR_BUTTON)); |
1786 sync_error_button->SetIcon( | 1786 sync_error_button->SetIcon( |
1787 *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); | 1787 *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); |
1788 return sync_error_button; | 1788 return sync_error_button; |
1789 } | 1789 } |
OLD | NEW |