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 28 matching lines...) Expand all Loading... |
39 #include "content/browser/tab_contents/page_navigator.h" | 39 #include "content/browser/tab_contents/page_navigator.h" |
40 #include "content/browser/tab_contents/tab_contents.h" | 40 #include "content/browser/tab_contents/tab_contents.h" |
41 #include "content/browser/user_metrics.h" | 41 #include "content/browser/user_metrics.h" |
42 #include "content/common/notification_service.h" | 42 #include "content/common/notification_service.h" |
43 #include "content/common/page_transition_types.h" | 43 #include "content/common/page_transition_types.h" |
44 #include "grit/generated_resources.h" | 44 #include "grit/generated_resources.h" |
45 #include "grit/theme_resources.h" | 45 #include "grit/theme_resources.h" |
46 #include "grit/ui_resources.h" | 46 #include "grit/ui_resources.h" |
47 #include "ui/base/accessibility/accessible_view_state.h" | 47 #include "ui/base/accessibility/accessible_view_state.h" |
48 #include "ui/base/animation/slide_animation.h" | 48 #include "ui/base/animation/slide_animation.h" |
| 49 #include "ui/base/dragdrop/bookmark_format.h" |
49 #include "ui/base/dragdrop/os_exchange_data.h" | 50 #include "ui/base/dragdrop/os_exchange_data.h" |
50 #include "ui/base/l10n/l10n_util.h" | 51 #include "ui/base/l10n/l10n_util.h" |
51 #include "ui/base/resource/resource_bundle.h" | 52 #include "ui/base/resource/resource_bundle.h" |
52 #include "ui/base/text/text_elider.h" | 53 #include "ui/base/text/text_elider.h" |
53 #include "ui/gfx/canvas_skia.h" | 54 #include "ui/gfx/canvas_skia.h" |
54 #include "views/controls/button/menu_button.h" | 55 #include "views/controls/button/menu_button.h" |
55 #include "views/controls/label.h" | 56 #include "views/controls/label.h" |
56 #include "views/controls/menu/menu_item_view.h" | 57 #include "views/controls/menu/menu_item_view.h" |
57 #include "views/drag_utils.h" | 58 #include "views/drag_utils.h" |
58 #include "views/metrics.h" | 59 #include "views/metrics.h" |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 indicator_bounds.height()); | 674 indicator_bounds.height()); |
674 } | 675 } |
675 } | 676 } |
676 | 677 |
677 bool BookmarkBarView::GetDropFormats( | 678 bool BookmarkBarView::GetDropFormats( |
678 int* formats, | 679 int* formats, |
679 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) { | 680 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) { |
680 if (!model_ || !model_->IsLoaded()) | 681 if (!model_ || !model_->IsLoaded()) |
681 return false; | 682 return false; |
682 *formats = ui::OSExchangeData::URL; | 683 *formats = ui::OSExchangeData::URL; |
683 custom_formats->insert(BookmarkNodeData::GetBookmarkCustomFormat()); | 684 custom_formats->insert(ui::GetBookmarkCustomFormat()); |
684 return true; | 685 return true; |
685 } | 686 } |
686 | 687 |
687 bool BookmarkBarView::AreDropTypesRequired() { | 688 bool BookmarkBarView::AreDropTypesRequired() { |
688 return true; | 689 return true; |
689 } | 690 } |
690 | 691 |
691 bool BookmarkBarView::CanDrop(const ui::OSExchangeData& data) { | 692 bool BookmarkBarView::CanDrop(const ui::OSExchangeData& data) { |
692 if (!model_ || !model_->IsLoaded() || | 693 if (!model_ || !model_->IsLoaded() || |
693 !browser_->profile()->GetPrefs()->GetBoolean( | 694 !browser_->profile()->GetPrefs()->GetBoolean( |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1732 (1 - size_animation_->GetCurrentValue()))); | 1733 (1 - size_animation_->GetCurrentValue()))); |
1733 } else { | 1734 } else { |
1734 prefsize.set_height( | 1735 prefsize.set_height( |
1735 static_cast<int>( | 1736 static_cast<int>( |
1736 browser_defaults::kBookmarkBarHeight * | 1737 browser_defaults::kBookmarkBarHeight * |
1737 size_animation_->GetCurrentValue())); | 1738 size_animation_->GetCurrentValue())); |
1738 } | 1739 } |
1739 } | 1740 } |
1740 return prefsize; | 1741 return prefsize; |
1741 } | 1742 } |
OLD | NEW |