OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/bookmark_bar_view.h" | 5 #include "chrome/browser/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 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 page_navigator_, GetWindow()->GetNativeWindow(), node, start_index); | 1180 page_navigator_, GetWindow()->GetNativeWindow(), node, start_index); |
1181 bookmark_menu_->set_observer(this); | 1181 bookmark_menu_->set_observer(this); |
1182 bookmark_menu_->RunMenuAt(this, false); | 1182 bookmark_menu_->RunMenuAt(this, false); |
1183 } | 1183 } |
1184 | 1184 |
1185 void BookmarkBarView::ButtonPressed(views::Button* sender, | 1185 void BookmarkBarView::ButtonPressed(views::Button* sender, |
1186 const views::Event& event) { | 1186 const views::Event& event) { |
1187 // Show the login wizard if the user clicked the re-login button. | 1187 // Show the login wizard if the user clicked the re-login button. |
1188 if (sender->tag() == kSyncErrorButtonTag) { | 1188 if (sender->tag() == kSyncErrorButtonTag) { |
1189 DCHECK(sender == sync_error_button_); | 1189 DCHECK(sender == sync_error_button_); |
1190 DCHECK(sync_service_); | 1190 DCHECK(sync_service_ && !sync_service_->IsManaged()); |
1191 sync_service_->ShowLoginDialog(); | 1191 sync_service_->ShowLoginDialog(); |
1192 return; | 1192 return; |
1193 } | 1193 } |
1194 | 1194 |
1195 const BookmarkNode* node; | 1195 const BookmarkNode* node; |
1196 if (sender->tag() == kOtherFolderButtonTag) { | 1196 if (sender->tag() == kOtherFolderButtonTag) { |
1197 node = model_->other_node(); | 1197 node = model_->other_node(); |
1198 } else { | 1198 } else { |
1199 int index = GetChildIndex(sender); | 1199 int index = GetChildIndex(sender); |
1200 DCHECK_NE(-1, index); | 1200 DCHECK_NE(-1, index); |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1718 // The tooltip is the only way we have to display text explaining the error | 1718 // The tooltip is the only way we have to display text explaining the error |
1719 // to the user. | 1719 // to the user. |
1720 sync_error_button->SetTooltipText( | 1720 sync_error_button->SetTooltipText( |
1721 l10n_util::GetString(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC)); | 1721 l10n_util::GetString(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC)); |
1722 sync_error_button->SetAccessibleName( | 1722 sync_error_button->SetAccessibleName( |
1723 l10n_util::GetString(IDS_ACCNAME_SYNC_ERROR_BUTTON)); | 1723 l10n_util::GetString(IDS_ACCNAME_SYNC_ERROR_BUTTON)); |
1724 sync_error_button->SetIcon( | 1724 sync_error_button->SetIcon( |
1725 *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); | 1725 *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); |
1726 return sync_error_button; | 1726 return sync_error_button; |
1727 } | 1727 } |
OLD | NEW |