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 22 matching lines...) Expand all Loading... |
33 #include "chrome/common/chrome_notification_types.h" | 33 #include "chrome/common/chrome_notification_types.h" |
34 #include "chrome/common/chrome_switches.h" | 34 #include "chrome/common/chrome_switches.h" |
35 #include "chrome/common/extensions/extension_constants.h" | 35 #include "chrome/common/extensions/extension_constants.h" |
36 #include "chrome/common/pref_names.h" | 36 #include "chrome/common/pref_names.h" |
37 #include "content/browser/renderer_host/render_view_host.h" | 37 #include "content/browser/renderer_host/render_view_host.h" |
38 #include "content/browser/renderer_host/render_widget_host_view.h" | 38 #include "content/browser/renderer_host/render_widget_host_view.h" |
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/public/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/os_exchange_data.h" | 49 #include "ui/base/dragdrop/os_exchange_data.h" |
50 #include "ui/base/l10n/l10n_util.h" | 50 #include "ui/base/l10n/l10n_util.h" |
51 #include "ui/base/resource/resource_bundle.h" | 51 #include "ui/base/resource/resource_bundle.h" |
52 #include "ui/base/text/text_elider.h" | 52 #include "ui/base/text/text_elider.h" |
53 #include "ui/gfx/canvas_skia.h" | 53 #include "ui/gfx/canvas_skia.h" |
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 } | 1057 } |
1058 DCHECK(page_navigator_); | 1058 DCHECK(page_navigator_); |
1059 | 1059 |
1060 WindowOpenDisposition disposition_from_event_flags = | 1060 WindowOpenDisposition disposition_from_event_flags = |
1061 event_utils::DispositionFromEventFlags(sender->mouse_event_flags()); | 1061 event_utils::DispositionFromEventFlags(sender->mouse_event_flags()); |
1062 | 1062 |
1063 Profile* profile = browser_->profile(); | 1063 Profile* profile = browser_->profile(); |
1064 if (node->is_url()) { | 1064 if (node->is_url()) { |
1065 RecordAppLaunch(profile, node->url()); | 1065 RecordAppLaunch(profile, node->url()); |
1066 page_navigator_->OpenURL(node->url(), GURL(), | 1066 page_navigator_->OpenURL(node->url(), GURL(), |
1067 disposition_from_event_flags, PageTransition::AUTO_BOOKMARK); | 1067 disposition_from_event_flags, content::PAGE_TRANSITION_AUTO_BOOKMARK); |
1068 } else { | 1068 } else { |
1069 bookmark_utils::OpenAll(GetWidget()->GetNativeWindow(), profile, | 1069 bookmark_utils::OpenAll(GetWidget()->GetNativeWindow(), profile, |
1070 page_navigator_, node, disposition_from_event_flags); | 1070 page_navigator_, node, disposition_from_event_flags); |
1071 } | 1071 } |
1072 UserMetrics::RecordAction(UserMetricsAction("ClickedBookmarkBarURLButton")); | 1072 UserMetrics::RecordAction(UserMetricsAction("ClickedBookmarkBarURLButton")); |
1073 } | 1073 } |
1074 | 1074 |
1075 void BookmarkBarView::ShowContextMenuForView(View* source, | 1075 void BookmarkBarView::ShowContextMenuForView(View* source, |
1076 const gfx::Point& p, | 1076 const gfx::Point& p, |
1077 bool is_mouse_gesture) { | 1077 bool is_mouse_gesture) { |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1732 (1 - size_animation_->GetCurrentValue()))); | 1732 (1 - size_animation_->GetCurrentValue()))); |
1733 } else { | 1733 } else { |
1734 prefsize.set_height( | 1734 prefsize.set_height( |
1735 static_cast<int>( | 1735 static_cast<int>( |
1736 browser_defaults::kBookmarkBarHeight * | 1736 browser_defaults::kBookmarkBarHeight * |
1737 size_animation_->GetCurrentValue())); | 1737 size_animation_->GetCurrentValue())); |
1738 } | 1738 } |
1739 } | 1739 } |
1740 return prefsize; | 1740 return prefsize; |
1741 } | 1741 } |
OLD | NEW |