| 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 } // namespace | 434 } // namespace |
| 435 | 435 |
| 436 OmniboxViewWin::OmniboxViewWin(AutocompleteEditController* controller, | 436 OmniboxViewWin::OmniboxViewWin(AutocompleteEditController* controller, |
| 437 ToolbarModel* toolbar_model, | 437 ToolbarModel* toolbar_model, |
| 438 LocationBarView* parent_view, | 438 LocationBarView* parent_view, |
| 439 CommandUpdater* command_updater, | 439 CommandUpdater* command_updater, |
| 440 bool popup_window_mode, | 440 bool popup_window_mode, |
| 441 views::View* location_bar) | 441 views::View* location_bar) |
| 442 : model_(new AutocompleteEditModel(this, controller, | 442 : model_(new AutocompleteEditModel(this, controller, |
| 443 parent_view->profile())), | 443 parent_view->profile())), |
| 444 popup_view_(AutocompletePopupContentsView::CreateForEnvironment( | 444 popup_view_(OmniboxPopupContentsView::CreateForEnvironment( |
| 445 parent_view->font(), this, model_.get(), location_bar)), | 445 parent_view->font(), this, model_.get(), location_bar)), |
| 446 controller_(controller), | 446 controller_(controller), |
| 447 parent_view_(parent_view), | 447 parent_view_(parent_view), |
| 448 toolbar_model_(toolbar_model), | 448 toolbar_model_(toolbar_model), |
| 449 command_updater_(command_updater), | 449 command_updater_(command_updater), |
| 450 popup_window_mode_(popup_window_mode), | 450 popup_window_mode_(popup_window_mode), |
| 451 force_hidden_(false), | 451 force_hidden_(false), |
| 452 tracking_click_(), | 452 tracking_click_(), |
| 453 tracking_double_click_(false), | 453 tracking_double_click_(false), |
| 454 double_click_time_(0), | 454 double_click_time_(0), |
| (...skipping 2217 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 } |
| OLD | NEW |