| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/omnibox/omnibox_view_win.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_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 12 matching lines...) Expand all Loading... |
| 23 #include "base/win/metro.h" | 23 #include "base/win/metro.h" |
| 24 #include "base/win/scoped_hdc.h" | 24 #include "base/win/scoped_hdc.h" |
| 25 #include "base/win/scoped_select_object.h" | 25 #include "base/win/scoped_select_object.h" |
| 26 #include "base/win/windows_version.h" | 26 #include "base/win/windows_version.h" |
| 27 #include "chrome/app/chrome_command_ids.h" | 27 #include "chrome/app/chrome_command_ids.h" |
| 28 #include "chrome/browser/autocomplete/autocomplete_input.h" | 28 #include "chrome/browser/autocomplete/autocomplete_input.h" |
| 29 #include "chrome/browser/autocomplete/autocomplete_match.h" | 29 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 30 #include "chrome/browser/autocomplete/keyword_provider.h" | 30 #include "chrome/browser/autocomplete/keyword_provider.h" |
| 31 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 31 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
| 32 #include "chrome/browser/command_updater.h" | 32 #include "chrome/browser/command_updater.h" |
| 33 #include "chrome/browser/instant/search.h" |
| 33 #include "chrome/browser/net/url_fixer_upper.h" | 34 #include "chrome/browser/net/url_fixer_upper.h" |
| 34 #include "chrome/browser/profiles/profile.h" | 35 #include "chrome/browser/profiles/profile.h" |
| 35 #include "chrome/browser/ui/browser.h" | 36 #include "chrome/browser/ui/browser.h" |
| 36 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" | 37 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" |
| 37 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" | 38 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
| 38 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" | 39 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" |
| 39 #include "chrome/browser/ui/search/search.h" | |
| 40 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 40 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 41 #include "chrome/browser/ui/views/missing_system_file_dialog_win.h" | 41 #include "chrome/browser/ui/views/missing_system_file_dialog_win.h" |
| 42 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" | 42 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
| 43 #include "chrome/common/chrome_notification_types.h" | 43 #include "chrome/common/chrome_notification_types.h" |
| 44 #include "content/public/browser/user_metrics.h" | 44 #include "content/public/browser/user_metrics.h" |
| 45 #include "content/public/browser/web_contents.h" | 45 #include "content/public/browser/web_contents.h" |
| 46 #include "googleurl/src/url_util.h" | 46 #include "googleurl/src/url_util.h" |
| 47 #include "grit/generated_resources.h" | 47 #include "grit/generated_resources.h" |
| 48 #include "net/base/escape.h" | 48 #include "net/base/escape.h" |
| 49 #include "skia/ext/skia_utils_win.h" | 49 #include "skia/ext/skia_utils_win.h" |
| (...skipping 2792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2842 return (rect.left - client_rect.left) + (client_rect.right - rect.right); | 2842 return (rect.left - client_rect.left) + (client_rect.right - rect.right); |
| 2843 } | 2843 } |
| 2844 | 2844 |
| 2845 int OmniboxViewWin::WidthNeededToDisplay(const string16& text) const { | 2845 int OmniboxViewWin::WidthNeededToDisplay(const string16& text) const { |
| 2846 // Use font_.GetStringWidth() instead of | 2846 // Use font_.GetStringWidth() instead of |
| 2847 // PosFromChar(location_entry_->GetTextLength()) because PosFromChar() is | 2847 // PosFromChar(location_entry_->GetTextLength()) because PosFromChar() is |
| 2848 // apparently buggy. In both LTR UI and RTL UI with left-to-right layout, | 2848 // apparently buggy. In both LTR UI and RTL UI with left-to-right layout, |
| 2849 // PosFromChar(i) might return 0 when i is greater than 1. | 2849 // PosFromChar(i) might return 0 when i is greater than 1. |
| 2850 return font_.GetStringWidth(text) + GetHorizontalMargin(); | 2850 return font_.GetStringWidth(text) + GetHorizontalMargin(); |
| 2851 } | 2851 } |
| OLD | NEW |