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/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 2661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2672 // PosFromChar(i) might return 0 when i is greater than 1. | 2672 // PosFromChar(i) might return 0 when i is greater than 1. |
2673 return font_.GetStringWidth(text) + GetHorizontalMargin(); | 2673 return font_.GetStringWidth(text) + GetHorizontalMargin(); |
2674 } | 2674 } |
2675 | 2675 |
2676 bool OmniboxViewWin::IsCaretAtEnd() const { | 2676 bool OmniboxViewWin::IsCaretAtEnd() const { |
2677 long length = GetTextLength(); | 2677 long length = GetTextLength(); |
2678 CHARRANGE sel; | 2678 CHARRANGE sel; |
2679 GetSelection(sel); | 2679 GetSelection(sel); |
2680 return sel.cpMin == sel.cpMax && sel.cpMin == length; | 2680 return sel.cpMin == sel.cpMax && sel.cpMin == length; |
2681 } | 2681 } |
2682 | |
2683 #if !defined(USE_AURA) | |
2684 // static | |
2685 OmniboxView* OmniboxView::CreateOmniboxView( | |
2686 AutocompleteEditController* controller, | |
2687 ToolbarModel* toolbar_model, | |
2688 Profile* profile, | |
2689 CommandUpdater* command_updater, | |
2690 bool popup_window_mode, | |
2691 LocationBarView* location_bar) { | |
2692 return new OmniboxViewWin(controller, | |
2693 toolbar_model, | |
2694 location_bar, | |
2695 command_updater, | |
2696 popup_window_mode, | |
2697 location_bar); | |
2698 } | |
2699 #endif | |
OLD | NEW |