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

Side by Side Diff: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm

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
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/cocoa/omnibox/omnibox_view_mac.h" 5 #include "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h"
6 6
7 #include <Carbon/Carbon.h> // kVK_Return 7 #include <Carbon/Carbon.h> // kVK_Return
8 8
9 #include "base/property_bag.h" 9 #include "base/property_bag.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 return false; 866 return false;
867 } 867 }
868 868
869 void OmniboxViewMac::OnSetFocus(bool control_down) { 869 void OmniboxViewMac::OnSetFocus(bool control_down) {
870 model_->OnSetFocus(control_down); 870 model_->OnSetFocus(control_down);
871 controller_->OnSetFocus(); 871 controller_->OnSetFocus();
872 } 872 }
873 873
874 void OmniboxViewMac::OnKillFocus() { 874 void OmniboxViewMac::OnKillFocus() {
875 // Tell the model to reset itself. 875 // Tell the model to reset itself.
876 model_->OnWillKillFocus(NULL); 876 model_->OnWillKillFocus();
877 model_->OnKillFocus(); 877 model_->OnKillFocus();
878 controller_->OnKillFocus(); 878 controller_->OnKillFocus();
879 } 879 }
880 880
881 bool OmniboxViewMac::CanCopy() { 881 bool OmniboxViewMac::CanCopy() {
882 const NSRange selection = GetSelectedRange(); 882 const NSRange selection = GetSelectedRange();
883 return selection.length > 0; 883 return selection.length > 0;
884 } 884 }
885 885
886 void OmniboxViewMac::CopyToPasteboard(NSPasteboard* pb) { 886 void OmniboxViewMac::CopyToPasteboard(NSPasteboard* pb) {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 1041
1042 void OmniboxViewMac::PlaceCaretAt(NSUInteger pos) { 1042 void OmniboxViewMac::PlaceCaretAt(NSUInteger pos) {
1043 DCHECK(pos <= GetTextLength()); 1043 DCHECK(pos <= GetTextLength());
1044 SetSelectedRange(NSMakeRange(pos, pos)); 1044 SetSelectedRange(NSMakeRange(pos, pos));
1045 } 1045 }
1046 1046
1047 bool OmniboxViewMac::IsCaretAtEnd() const { 1047 bool OmniboxViewMac::IsCaretAtEnd() const {
1048 const NSRange selection = GetSelectedRange(); 1048 const NSRange selection = GetSelectedRange();
1049 return selection.length == 0 && selection.location == GetTextLength(); 1049 return selection.length == 0 && selection.location == GetTextLength();
1050 } 1050 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698