OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "chrome/common/extensions/extension_metrics.h" | 48 #include "chrome/common/extensions/extension_metrics.h" |
49 #include "chrome/common/pref_names.h" | 49 #include "chrome/common/pref_names.h" |
50 #include "chrome/common/url_constants.h" | 50 #include "chrome/common/url_constants.h" |
51 #include "chrome/grit/generated_resources.h" | 51 #include "chrome/grit/generated_resources.h" |
52 #include "components/bookmarks/browser/bookmark_model.h" | 52 #include "components/bookmarks/browser/bookmark_model.h" |
53 #include "components/bookmarks/browser/bookmark_utils.h" | 53 #include "components/bookmarks/browser/bookmark_utils.h" |
54 #include "components/bookmarks/managed/managed_bookmark_service.h" | 54 #include "components/bookmarks/managed/managed_bookmark_service.h" |
55 #include "components/metrics/metrics_service.h" | 55 #include "components/metrics/metrics_service.h" |
56 #include "components/omnibox/browser/omnibox_popup_model.h" | 56 #include "components/omnibox/browser/omnibox_popup_model.h" |
57 #include "components/omnibox/browser/omnibox_view.h" | 57 #include "components/omnibox/browser/omnibox_view.h" |
58 #include "components/secure_display/elide_url.h" | 58 #include "components/url_formatter/elide_url.h" |
59 #include "content/public/browser/notification_details.h" | 59 #include "content/public/browser/notification_details.h" |
60 #include "content/public/browser/notification_source.h" | 60 #include "content/public/browser/notification_source.h" |
61 #include "content/public/browser/page_navigator.h" | 61 #include "content/public/browser/page_navigator.h" |
62 #include "content/public/browser/render_view_host.h" | 62 #include "content/public/browser/render_view_host.h" |
63 #include "content/public/browser/render_widget_host_view.h" | 63 #include "content/public/browser/render_widget_host_view.h" |
64 #include "content/public/browser/user_metrics.h" | 64 #include "content/public/browser/user_metrics.h" |
65 #include "content/public/browser/web_contents.h" | 65 #include "content/public/browser/web_contents.h" |
66 #include "extensions/browser/extension_registry.h" | 66 #include "extensions/browser/extension_registry.h" |
67 #include "extensions/common/extension.h" | 67 #include "extensions/common/extension.h" |
68 #include "extensions/common/extension_set.h" | 68 #include "extensions/common/extension_set.h" |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 | 715 |
716 // We need to explicitly specify the directionality of the URL's text to | 716 // We need to explicitly specify the directionality of the URL's text to |
717 // make sure it is treated as an LTR string when the context is RTL. For | 717 // make sure it is treated as an LTR string when the context is RTL. For |
718 // example, the URL "http://www.yahoo.com/" appears as | 718 // example, the URL "http://www.yahoo.com/" appears as |
719 // "/http://www.yahoo.com" when rendered, as is, in an RTL context since | 719 // "/http://www.yahoo.com" when rendered, as is, in an RTL context since |
720 // the Unicode BiDi algorithm puts certain characters on the left by | 720 // the Unicode BiDi algorithm puts certain characters on the left by |
721 // default. | 721 // default. |
722 std::string languages = profile->GetPrefs()->GetString( | 722 std::string languages = profile->GetPrefs()->GetString( |
723 prefs::kAcceptLanguages); | 723 prefs::kAcceptLanguages); |
724 base::string16 elided_url( | 724 base::string16 elided_url( |
725 secure_display::ElideUrl(url, tt_fonts, max_width, languages)); | 725 url_formatter::ElideUrl(url, tt_fonts, max_width, languages)); |
726 elided_url = base::i18n::GetDisplayStringInLTRDirectionality(elided_url); | 726 elided_url = base::i18n::GetDisplayStringInLTRDirectionality(elided_url); |
727 result.append(elided_url); | 727 result.append(elided_url); |
728 } | 728 } |
729 return result; | 729 return result; |
730 } | 730 } |
731 | 731 |
732 bool BookmarkBarView::IsDetached() const { | 732 bool BookmarkBarView::IsDetached() const { |
733 return (bookmark_bar_state_ == BookmarkBar::DETACHED) || | 733 return (bookmark_bar_state_ == BookmarkBar::DETACHED) || |
734 (animating_detached_ && size_animation_->is_animating()); | 734 (animating_detached_ && size_animation_->is_animating()); |
735 } | 735 } |
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2075 return; | 2075 return; |
2076 apps_page_shortcut_->SetVisible(visible); | 2076 apps_page_shortcut_->SetVisible(visible); |
2077 UpdateBookmarksSeparatorVisibility(); | 2077 UpdateBookmarksSeparatorVisibility(); |
2078 LayoutAndPaint(); | 2078 LayoutAndPaint(); |
2079 } | 2079 } |
2080 | 2080 |
2081 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { | 2081 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { |
2082 if (UpdateOtherAndManagedButtonsVisibility()) | 2082 if (UpdateOtherAndManagedButtonsVisibility()) |
2083 LayoutAndPaint(); | 2083 LayoutAndPaint(); |
2084 } | 2084 } |
OLD | NEW |