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/bookmark_bar_view.h" | 5 #include "chrome/browser/ui/views/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 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 bookmark_menu_->set_observer(this); | 1198 bookmark_menu_->set_observer(this); |
1199 bookmark_menu_->RunMenuAt(this, false); | 1199 bookmark_menu_->RunMenuAt(this, false); |
1200 } | 1200 } |
1201 | 1201 |
1202 void BookmarkBarView::ButtonPressed(views::Button* sender, | 1202 void BookmarkBarView::ButtonPressed(views::Button* sender, |
1203 const views::Event& event) { | 1203 const views::Event& event) { |
1204 // Show the login wizard if the user clicked the re-login button. | 1204 // Show the login wizard if the user clicked the re-login button. |
1205 if (sender->tag() == kSyncErrorButtonTag) { | 1205 if (sender->tag() == kSyncErrorButtonTag) { |
1206 DCHECK(sender == sync_error_button_); | 1206 DCHECK(sender == sync_error_button_); |
1207 DCHECK(sync_service_ && !sync_service_->IsManaged()); | 1207 DCHECK(sync_service_ && !sync_service_->IsManaged()); |
1208 sync_service_->ShowLoginDialog(GetWindow()->GetNativeWindow()); | 1208 sync_service_->ShowErrorUI(GetWindow()->GetNativeWindow()); |
1209 return; | 1209 return; |
1210 } | 1210 } |
1211 | 1211 |
1212 const BookmarkNode* node; | 1212 const BookmarkNode* node; |
1213 if (sender->tag() == kOtherFolderButtonTag) { | 1213 if (sender->tag() == kOtherFolderButtonTag) { |
1214 node = model_->other_node(); | 1214 node = model_->other_node(); |
1215 } else { | 1215 } else { |
1216 int index = GetChildIndex(sender); | 1216 int index = GetChildIndex(sender); |
1217 DCHECK_NE(-1, index); | 1217 DCHECK_NE(-1, index); |
1218 node = model_->GetBookmarkBarNode()->GetChild(index); | 1218 node = model_->GetBookmarkBarNode()->GetChild(index); |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1734 // The tooltip is the only way we have to display text explaining the error | 1734 // The tooltip is the only way we have to display text explaining the error |
1735 // to the user. | 1735 // to the user. |
1736 sync_error_button->SetTooltipText( | 1736 sync_error_button->SetTooltipText( |
1737 UTF16ToWide(l10n_util::GetStringUTF16(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC))); | 1737 UTF16ToWide(l10n_util::GetStringUTF16(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC))); |
1738 sync_error_button->SetAccessibleName( | 1738 sync_error_button->SetAccessibleName( |
1739 l10n_util::GetStringUTF16(IDS_ACCNAME_SYNC_ERROR_BUTTON)); | 1739 l10n_util::GetStringUTF16(IDS_ACCNAME_SYNC_ERROR_BUTTON)); |
1740 sync_error_button->SetIcon( | 1740 sync_error_button->SetIcon( |
1741 *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); | 1741 *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); |
1742 return sync_error_button; | 1742 return sync_error_button; |
1743 } | 1743 } |
OLD | NEW |