Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_view_win.cc

Issue 10732002: Upstream rewrite of Instant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Extreme nits. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_views.cc ('k') | chrome/common/instant_types.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 } 1522 }
1523 1523
1524 void OmniboxViewWin::OnKillFocus(HWND focus_wnd) { 1524 void OmniboxViewWin::OnKillFocus(HWND focus_wnd) {
1525 if (m_hWnd == focus_wnd) { 1525 if (m_hWnd == focus_wnd) {
1526 // Focus isn't actually leaving. 1526 // Focus isn't actually leaving.
1527 SetMsgHandled(false); 1527 SetMsgHandled(false);
1528 return; 1528 return;
1529 } 1529 }
1530 1530
1531 // This must be invoked before ClosePopup. 1531 // This must be invoked before ClosePopup.
1532 model_->OnWillKillFocus(focus_wnd); 1532 model_->OnWillKillFocus();
1533 1533
1534 // Close the popup. 1534 // Close the popup.
1535 ClosePopup(); 1535 ClosePopup();
1536 1536
1537 // Save the user's existing selection to restore it later. 1537 // Save the user's existing selection to restore it later.
1538 GetSelection(saved_selection_for_focus_change_); 1538 GetSelection(saved_selection_for_focus_change_);
1539 1539
1540 // Tell the model to reset itself. 1540 // Tell the model to reset itself.
1541 model_->OnKillFocus(); 1541 model_->OnKillFocus();
1542 1542
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2666 // PosFromChar(i) might return 0 when i is greater than 1. 2666 // PosFromChar(i) might return 0 when i is greater than 1.
2667 return font_.GetStringWidth(text) + GetHorizontalMargin(); 2667 return font_.GetStringWidth(text) + GetHorizontalMargin();
2668 } 2668 }
2669 2669
2670 bool OmniboxViewWin::IsCaretAtEnd() const { 2670 bool OmniboxViewWin::IsCaretAtEnd() const {
2671 long length = GetTextLength(); 2671 long length = GetTextLength();
2672 CHARRANGE sel; 2672 CHARRANGE sel;
2673 GetSelection(sel); 2673 GetSelection(sel);
2674 return sel.cpMin == sel.cpMax && sel.cpMin == length; 2674 return sel.cpMin == sel.cpMax && sel.cpMin == length;
2675 } 2675 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_views.cc ('k') | chrome/common/instant_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698