OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/location_bar_view.h" | 5 #include "chrome/browser/views/location_bar_view.h" |
6 | 6 |
7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
11 #include "app/gfx/canvas.h" | 11 #include "app/gfx/canvas.h" |
12 #include "app/l10n_util.h" | 12 #include "app/l10n_util.h" |
13 #include "app/resource_bundle.h" | 13 #include "app/resource_bundle.h" |
14 #include "app/theme_provider.h" | 14 #include "app/theme_provider.h" |
| 15 #include "base/i18n/rtl.h" |
15 #include "base/stl_util-inl.h" | 16 #include "base/stl_util-inl.h" |
16 #include "chrome/app/chrome_dll_resource.h" | 17 #include "chrome/app/chrome_dll_resource.h" |
17 #include "chrome/browser/alternate_nav_url_fetcher.h" | 18 #include "chrome/browser/alternate_nav_url_fetcher.h" |
18 #include "chrome/browser/browser_list.h" | 19 #include "chrome/browser/browser_list.h" |
19 #include "chrome/browser/browser_window.h" | 20 #include "chrome/browser/browser_window.h" |
20 #include "chrome/browser/bubble_positioner.h" | 21 #include "chrome/browser/bubble_positioner.h" |
21 #include "chrome/browser/command_updater.h" | 22 #include "chrome/browser/command_updater.h" |
22 #include "chrome/browser/content_setting_bubble_model.h" | 23 #include "chrome/browser/content_setting_bubble_model.h" |
23 #include "chrome/browser/content_setting_image_model.h" | 24 #include "chrome/browser/content_setting_image_model.h" |
24 #include "chrome/browser/extensions/extension_browser_event_router.h" | 25 #include "chrome/browser/extensions/extension_browser_event_router.h" |
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 const size_t dot_index = description.find(L'.'); | 990 const size_t dot_index = description.find(L'.'); |
990 const size_t ws_index = description.find_first_of(kWhitespaceWide); | 991 const size_t ws_index = description.find_first_of(kWhitespaceWide); |
991 size_t chop_index = std::min(dot_index, ws_index); | 992 size_t chop_index = std::min(dot_index, ws_index); |
992 std::wstring min_string; | 993 std::wstring min_string; |
993 if (chop_index == std::wstring::npos) { | 994 if (chop_index == std::wstring::npos) { |
994 // No dot or whitespace, truncate to at most 3 chars. | 995 // No dot or whitespace, truncate to at most 3 chars. |
995 min_string = l10n_util::TruncateString(description, 3); | 996 min_string = l10n_util::TruncateString(description, 3); |
996 } else { | 997 } else { |
997 min_string = description.substr(0, chop_index); | 998 min_string = description.substr(0, chop_index); |
998 } | 999 } |
999 l10n_util::AdjustStringForLocaleDirection(min_string, &min_string); | 1000 base::i18n::AdjustStringForLocaleDirection(min_string, &min_string); |
1000 return min_string; | 1001 return min_string; |
1001 } | 1002 } |
1002 | 1003 |
1003 // KeywordHintView ------------------------------------------------------------- | 1004 // KeywordHintView ------------------------------------------------------------- |
1004 | 1005 |
1005 // Amount of space to offset the tab image from the top of the view by. | 1006 // Amount of space to offset the tab image from the top of the view by. |
1006 static const int kTabImageYOffset = 4; | 1007 static const int kTabImageYOffset = 4; |
1007 | 1008 |
1008 LocationBarView::KeywordHintView::KeywordHintView(Profile* profile) | 1009 LocationBarView::KeywordHintView::KeywordHintView(Profile* profile) |
1009 : profile_(profile) { | 1010 : profile_(profile) { |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1738 page_action_views_[i]->image_view()->ExecuteAction(kLeftMouseButton, | 1739 page_action_views_[i]->image_view()->ExecuteAction(kLeftMouseButton, |
1739 false); // inspect_with_devtools | 1740 false); // inspect_with_devtools |
1740 return; | 1741 return; |
1741 } | 1742 } |
1742 ++current; | 1743 ++current; |
1743 } | 1744 } |
1744 } | 1745 } |
1745 | 1746 |
1746 NOTREACHED(); | 1747 NOTREACHED(); |
1747 } | 1748 } |
OLD | NEW |