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/autocomplete/autocomplete_edit_view_win.h" | 5 #include "chrome/browser/autocomplete/autocomplete_edit_view_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <locale> | 8 #include <locale> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "base/utf_string_conversions.h" | 31 #include "base/utf_string_conversions.h" |
32 #include "chrome/app/chrome_command_ids.h" | 32 #include "chrome/app/chrome_command_ids.h" |
33 #include "chrome/browser/autocomplete/autocomplete_accessibility.h" | 33 #include "chrome/browser/autocomplete/autocomplete_accessibility.h" |
34 #include "chrome/browser/autocomplete/autocomplete_match.h" | 34 #include "chrome/browser/autocomplete/autocomplete_match.h" |
35 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" | 35 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" |
36 #include "chrome/browser/autocomplete/keyword_provider.h" | 36 #include "chrome/browser/autocomplete/keyword_provider.h" |
37 #include "chrome/browser/browser_process.h" | 37 #include "chrome/browser/browser_process.h" |
38 #include "chrome/browser/command_updater.h" | 38 #include "chrome/browser/command_updater.h" |
39 #include "chrome/browser/metrics/user_metrics.h" | 39 #include "chrome/browser/metrics/user_metrics.h" |
40 #include "chrome/browser/net/url_fixer_upper.h" | 40 #include "chrome/browser/net/url_fixer_upper.h" |
41 #include "chrome/browser/profile.h" | 41 #include "chrome/browser/profiles/profile.h" |
42 #include "chrome/browser/search_engines/template_url.h" | 42 #include "chrome/browser/search_engines/template_url.h" |
43 #include "chrome/browser/search_engines/template_url_model.h" | 43 #include "chrome/browser/search_engines/template_url_model.h" |
44 #include "chrome/browser/tab_contents/tab_contents.h" | 44 #include "chrome/browser/tab_contents/tab_contents.h" |
45 #include "chrome/browser/views/location_bar/location_bar_view.h" | 45 #include "chrome/browser/views/location_bar/location_bar_view.h" |
46 #include "chrome/common/notification_service.h" | 46 #include "chrome/common/notification_service.h" |
47 #include "googleurl/src/url_util.h" | 47 #include "googleurl/src/url_util.h" |
48 #include "gfx/canvas.h" | 48 #include "gfx/canvas.h" |
49 #include "gfx/canvas_skia.h" | 49 #include "gfx/canvas_skia.h" |
50 #include "grit/generated_resources.h" | 50 #include "grit/generated_resources.h" |
51 #include "net/base/escape.h" | 51 #include "net/base/escape.h" |
(...skipping 2534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2586 return (rect.left - client_rect.left) + (client_rect.right - rect.right); | 2586 return (rect.left - client_rect.left) + (client_rect.right - rect.right); |
2587 } | 2587 } |
2588 | 2588 |
2589 int AutocompleteEditViewWin::WidthNeededToDisplay(const std::wstring& text) { | 2589 int AutocompleteEditViewWin::WidthNeededToDisplay(const std::wstring& text) { |
2590 // Use font_.GetStringWidth() instead of | 2590 // Use font_.GetStringWidth() instead of |
2591 // PosFromChar(location_entry_->GetTextLength()) because PosFromChar() is | 2591 // PosFromChar(location_entry_->GetTextLength()) because PosFromChar() is |
2592 // apparently buggy. In both LTR UI and RTL UI with left-to-right layout, | 2592 // apparently buggy. In both LTR UI and RTL UI with left-to-right layout, |
2593 // PosFromChar(i) might return 0 when i is greater than 1. | 2593 // PosFromChar(i) might return 0 when i is greater than 1. |
2594 return font_.GetStringWidth(text) + GetHorizontalMargin(); | 2594 return font_.GetStringWidth(text) + GetHorizontalMargin(); |
2595 } | 2595 } |
OLD | NEW |