| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 } // namespace | 391 } // namespace |
| 392 | 392 |
| 393 OmniboxViewWin::OmniboxViewWin(const gfx::Font& font, | 393 OmniboxViewWin::OmniboxViewWin(const gfx::Font& font, |
| 394 AutocompleteEditController* controller, | 394 AutocompleteEditController* controller, |
| 395 ToolbarModel* toolbar_model, | 395 ToolbarModel* toolbar_model, |
| 396 LocationBarView* parent_view, | 396 LocationBarView* parent_view, |
| 397 HWND hwnd, | 397 HWND hwnd, |
| 398 Profile* profile, | 398 Profile* profile, |
| 399 CommandUpdater* command_updater, | 399 CommandUpdater* command_updater, |
| 400 bool popup_window_mode, | 400 bool popup_window_mode, |
| 401 const views::View* location_bar) | 401 views::View* location_bar) |
| 402 : model_(new AutocompleteEditModel(this, controller, profile)), | 402 : model_(new AutocompleteEditModel(this, controller, profile)), |
| 403 popup_view_(new AutocompletePopupContentsView(font, this, model_.get(), | 403 popup_view_(new AutocompletePopupContentsView(font, this, model_.get(), |
| 404 profile, location_bar)), | 404 profile, location_bar)), |
| 405 controller_(controller), | 405 controller_(controller), |
| 406 parent_view_(parent_view), | 406 parent_view_(parent_view), |
| 407 toolbar_model_(toolbar_model), | 407 toolbar_model_(toolbar_model), |
| 408 command_updater_(command_updater), | 408 command_updater_(command_updater), |
| 409 popup_window_mode_(popup_window_mode), | 409 popup_window_mode_(popup_window_mode), |
| 410 force_hidden_(false), | 410 force_hidden_(false), |
| 411 tracking_click_(), | 411 tracking_click_(), |
| (...skipping 2186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2598 // PosFromChar(i) might return 0 when i is greater than 1. | 2598 // PosFromChar(i) might return 0 when i is greater than 1. |
| 2599 return font_.GetStringWidth(text) + GetHorizontalMargin(); | 2599 return font_.GetStringWidth(text) + GetHorizontalMargin(); |
| 2600 } | 2600 } |
| 2601 | 2601 |
| 2602 bool OmniboxViewWin::IsCaretAtEnd() const { | 2602 bool OmniboxViewWin::IsCaretAtEnd() const { |
| 2603 long length = GetTextLength(); | 2603 long length = GetTextLength(); |
| 2604 CHARRANGE sel; | 2604 CHARRANGE sel; |
| 2605 GetSelection(sel); | 2605 GetSelection(sel); |
| 2606 return sel.cpMin == sel.cpMax && sel.cpMin == length; | 2606 return sel.cpMin == sel.cpMax && sel.cpMin == length; |
| 2607 } | 2607 } |
| OLD | NEW |