| 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 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 bookmark_menu_->set_observer(this); | 1066 bookmark_menu_->set_observer(this); |
| 1067 bookmark_menu_->RunMenuAt(this, false); | 1067 bookmark_menu_->RunMenuAt(this, false); |
| 1068 } | 1068 } |
| 1069 | 1069 |
| 1070 void BookmarkBarView::ButtonPressed(views::Button* sender, | 1070 void BookmarkBarView::ButtonPressed(views::Button* sender, |
| 1071 const views::Event& event) { | 1071 const views::Event& event) { |
| 1072 // Show the login wizard if the user clicked the re-login button. | 1072 // Show the login wizard if the user clicked the re-login button. |
| 1073 if (sender->tag() == kSyncErrorButtonTag) { | 1073 if (sender->tag() == kSyncErrorButtonTag) { |
| 1074 DCHECK(sender == sync_error_button_); | 1074 DCHECK(sender == sync_error_button_); |
| 1075 DCHECK(sync_service_ && !sync_service_->IsManaged()); | 1075 DCHECK(sync_service_ && !sync_service_->IsManaged()); |
| 1076 sync_service_->ShowErrorUI(NULL); | 1076 sync_service_->ShowErrorUI(); |
| 1077 return; | 1077 return; |
| 1078 } | 1078 } |
| 1079 | 1079 |
| 1080 const BookmarkNode* node; | 1080 const BookmarkNode* node; |
| 1081 if (sender->tag() == kOtherFolderButtonTag) { | 1081 if (sender->tag() == kOtherFolderButtonTag) { |
| 1082 node = model_->other_node(); | 1082 node = model_->other_node(); |
| 1083 } else { | 1083 } else { |
| 1084 int index = GetIndexOf(sender); | 1084 int index = GetIndexOf(sender); |
| 1085 DCHECK_NE(-1, index); | 1085 DCHECK_NE(-1, index); |
| 1086 node = model_->GetBookmarkBarNode()->GetChild(index); | 1086 node = model_->GetBookmarkBarNode()->GetChild(index); |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1758 (1 - size_animation_->GetCurrentValue()))); | 1758 (1 - size_animation_->GetCurrentValue()))); |
| 1759 } else { | 1759 } else { |
| 1760 prefsize.set_height( | 1760 prefsize.set_height( |
| 1761 static_cast<int>( | 1761 static_cast<int>( |
| 1762 browser_defaults::kBookmarkBarHeight * | 1762 browser_defaults::kBookmarkBarHeight * |
| 1763 size_animation_->GetCurrentValue())); | 1763 size_animation_->GetCurrentValue())); |
| 1764 } | 1764 } |
| 1765 } | 1765 } |
| 1766 return prefsize; | 1766 return prefsize; |
| 1767 } | 1767 } |
| OLD | NEW |