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

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

Issue 7200045: Move app/mac/ files to ui/gfx/mac/ directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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) 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/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 "app/mac/nsimage_cache.h"
10 #include "base/string_util.h" 9 #include "base/string_util.h"
11 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
12 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
13 #include "chrome/browser/autocomplete/autocomplete_edit.h" 12 #include "chrome/browser/autocomplete/autocomplete_edit.h"
14 #include "chrome/browser/autocomplete/autocomplete_match.h" 13 #include "chrome/browser/autocomplete/autocomplete_match.h"
15 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" 14 #include "chrome/browser/autocomplete/autocomplete_popup_model.h"
16 #include "chrome/browser/autocomplete/autocomplete_popup_view_mac.h" 15 #include "chrome/browser/autocomplete/autocomplete_popup_view_mac.h"
17 #include "chrome/browser/browser_process.h" 16 #include "chrome/browser/browser_process.h"
18 #include "chrome/browser/ui/cocoa/event_utils.h" 17 #include "chrome/browser/ui/cocoa/event_utils.h"
19 #include "chrome/browser/ui/toolbar/toolbar_model.h" 18 #include "chrome/browser/ui/toolbar/toolbar_model.h"
20 #include "content/browser/tab_contents/tab_contents.h" 19 #include "content/browser/tab_contents/tab_contents.h"
21 #include "grit/generated_resources.h" 20 #include "grit/generated_resources.h"
22 #include "grit/theme_resources.h" 21 #include "grit/theme_resources.h"
23 #include "grit/theme_resources_standard.h" 22 #include "grit/theme_resources_standard.h"
24 #include "net/base/escape.h" 23 #include "net/base/escape.h"
25 #import "third_party/mozilla/NSPasteboard+Utils.h" 24 #import "third_party/mozilla/NSPasteboard+Utils.h"
26 #include "ui/base/clipboard/clipboard.h" 25 #include "ui/base/clipboard/clipboard.h"
27 #include "ui/base/resource/resource_bundle.h" 26 #include "ui/base/resource/resource_bundle.h"
28 #include "ui/gfx/image/image.h" 27 #include "ui/gfx/image/image.h"
28 #include "ui/gfx/mac/nsimage_cache.h"
29 #include "ui/gfx/rect.h" 29 #include "ui/gfx/rect.h"
30 30
31 // Focus-handling between |field_| and |model_| is a bit subtle. 31 // Focus-handling between |field_| and |model_| is a bit subtle.
32 // Other platforms detect change of focus, which is inconvenient 32 // Other platforms detect change of focus, which is inconvenient
33 // without subclassing NSTextField (even with a subclass, the use of a 33 // without subclassing NSTextField (even with a subclass, the use of a
34 // field editor may complicate things). 34 // field editor may complicate things).
35 // 35 //
36 // |model_| doesn't actually do anything when it gains focus, it just 36 // |model_| doesn't actually do anything when it gains focus, it just
37 // initializes. Visible activity happens only after the user edits. 37 // initializes. Visible activity happens only after the user edits.
38 // NSTextField delegate receives messages around starting and ending 38 // NSTextField delegate receives messages around starting and ending
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 1115
1116 void OmniboxViewMac::PlaceCaretAt(NSUInteger pos) { 1116 void OmniboxViewMac::PlaceCaretAt(NSUInteger pos) {
1117 DCHECK(pos <= GetTextLength()); 1117 DCHECK(pos <= GetTextLength());
1118 SetSelectedRange(NSMakeRange(pos, pos)); 1118 SetSelectedRange(NSMakeRange(pos, pos));
1119 } 1119 }
1120 1120
1121 bool OmniboxViewMac::IsCaretAtEnd() const { 1121 bool OmniboxViewMac::IsCaretAtEnd() const {
1122 const NSRange selection = GetSelectedRange(); 1122 const NSRange selection = GetSelectedRange();
1123 return selection.length == 0 && selection.location == GetTextLength(); 1123 return selection.length == 0 && selection.location == GetTextLength();
1124 } 1124 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698