OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/base_drag_source.h" | 10 #include "base/base_drag_source.h" |
(...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1425 } | 1425 } |
1426 break; | 1426 break; |
1427 } | 1427 } |
1428 } | 1428 } |
1429 } | 1429 } |
1430 | 1430 |
1431 bool BookmarkBarView::AddExtensionToolstrips(const ExtensionList* extensions) { | 1431 bool BookmarkBarView::AddExtensionToolstrips(const ExtensionList* extensions) { |
1432 bool added_toolstrip = false; | 1432 bool added_toolstrip = false; |
1433 for (ExtensionList::const_iterator extension = extensions->begin(); | 1433 for (ExtensionList::const_iterator extension = extensions->begin(); |
1434 extension != extensions->end(); ++extension) { | 1434 extension != extensions->end(); ++extension) { |
1435 for (std::vector<std::string>::const_iterator toolstrip = | 1435 for (std::vector<std::string>::const_iterator toolstrip_path = |
1436 (*extension)->toolstrips().begin(); | 1436 (*extension)->toolstrips().begin(); |
1437 toolstrip != (*extension)->toolstrips().end(); ++toolstrip) { | 1437 toolstrip_path != (*extension)->toolstrips().end(); ++toolstrip_path) { |
1438 ExtensionToolstrip* view = | 1438 ExtensionToolstrip* toolstrip = |
1439 new ExtensionToolstrip(*extension, | 1439 new ExtensionToolstrip(*extension, |
1440 (*extension)->GetResourceURL(*toolstrip), | 1440 (*extension)->GetResourceURL(*toolstrip_path), |
1441 browser_); | 1441 browser_); |
1442 int index = GetBookmarkButtonCount() + num_extension_toolstrips_; | 1442 int index = GetBookmarkButtonCount() + num_extension_toolstrips_; |
1443 view->view()->SetBackground(toolstrip_background_); | 1443 if (!toolstrip_background_.empty()) |
1444 AddChildView(index, view); | 1444 toolstrip->view()->SetBackground(toolstrip_background_); |
| 1445 AddChildView(index, toolstrip); |
1445 added_toolstrip = true; | 1446 added_toolstrip = true; |
1446 ++num_extension_toolstrips_; | 1447 ++num_extension_toolstrips_; |
1447 } | 1448 } |
1448 } | 1449 } |
1449 | 1450 |
1450 return added_toolstrip; | 1451 return added_toolstrip; |
1451 } | 1452 } |
1452 | 1453 |
1453 void BookmarkBarView::RemoveNotificationObservers() { | 1454 void BookmarkBarView::RemoveNotificationObservers() { |
1454 NotificationService* ns = NotificationService::current(); | 1455 NotificationService* ns = NotificationService::current(); |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1710 } | 1711 } |
1711 | 1712 |
1712 void BookmarkBarView::StopThrobbing(bool immediate) { | 1713 void BookmarkBarView::StopThrobbing(bool immediate) { |
1713 if (!throbbing_view_) | 1714 if (!throbbing_view_) |
1714 return; | 1715 return; |
1715 | 1716 |
1716 // If not immediate, cycle through 2 more complete cycles. | 1717 // If not immediate, cycle through 2 more complete cycles. |
1717 throbbing_view_->StartThrobbing(immediate ? 0 : 4); | 1718 throbbing_view_->StartThrobbing(immediate ? 0 : 4); |
1718 throbbing_view_ = NULL; | 1719 throbbing_view_ = NULL; |
1719 } | 1720 } |
OLD | NEW |