15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#import <Cocoa/Cocoa.h>
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/memory/scoped_ptr.h"
11868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "base/strings/string16.h"
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h"
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/browser/ui/omnibox/omnibox_view.h"
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class OmniboxPopupView;
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace ui {
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Clipboard;
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Implements OmniboxView on an AutocompleteTextField.
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class OmniboxViewMac : public OmniboxView,
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                       public AutocompleteTextFieldObserver {
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public:
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  OmniboxViewMac(OmniboxEditController* controller,
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 Profile* profile,
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 CommandUpdater* command_updater,
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 AutocompleteTextField* field);
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual ~OmniboxViewMac();
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // OmniboxView:
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void SaveStateToTab(content::WebContents* tab) OVERRIDE;
33424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)  virtual void OnTabChanged(const content::WebContents* web_contents) OVERRIDE;
34424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)  virtual void Update() OVERRIDE;
35c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch  virtual void OpenMatch(const AutocompleteMatch& match,
36c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch                         WindowOpenDisposition disposition,
37c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch                         const GURL& alternate_nav_url,
38c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch                         const base::string16& pasted_text,
39c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch                         size_t selected_line) OVERRIDE;
40a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  virtual base::string16 GetText() const OVERRIDE;
41a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  virtual void SetWindowTextAndCaretPos(const base::string16& text,
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                        size_t caret_pos,
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                        bool update_popup,
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                        bool notify_text_changed) OVERRIDE;
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void SetForcedQuery() OVERRIDE;
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool IsSelectAll() const OVERRIDE;
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool DeleteAtEndPressed() OVERRIDE;
48a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  virtual void GetSelectionBounds(
49a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)      base::string16::size_type* start,
50a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)      base::string16::size_type* end) const OVERRIDE;
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void SelectAll(bool reversed) OVERRIDE;
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void RevertAll() OVERRIDE;
535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void UpdatePopup() OVERRIDE;
545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void CloseOmniboxPopup() OVERRIDE;
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void SetFocus() OVERRIDE;
562a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual void ApplyCaretVisibility() OVERRIDE;
575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnTemporaryTextMaybeChanged(
58a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)      const base::string16& display_text,
592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      bool save_original_selection,
602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      bool notify_text_changed) OVERRIDE;
615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool OnInlineAutocompleteTextMaybeChanged(
62a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)      const base::string16& display_text, size_t user_text_length) OVERRIDE;
63f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  virtual void OnInlineAutocompleteTextCleared() OVERRIDE;
645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnRevertTemporaryText() OVERRIDE;
655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnBeforePossibleChange() OVERRIDE;
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool OnAfterPossibleChange() OVERRIDE;
675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual gfx::NativeView GetNativeView() const OVERRIDE;
685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual gfx::NativeView GetRelativeWindowForPopup() const OVERRIDE;
69a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  virtual void SetGrayTextAutocompletion(const base::string16& input) OVERRIDE;
70a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  virtual base::string16 GetGrayTextAutocompletion() const OVERRIDE;
715d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual int GetTextWidth() const OVERRIDE;
725d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual int GetWidth() const OVERRIDE;
735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool IsImeComposing() const OVERRIDE;
745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Implement the AutocompleteTextFieldObserver interface.
765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual NSRange SelectionRangeForProposedRange(
775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      NSRange proposed_range) OVERRIDE;
785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnControlKeyChanged(bool pressed) OVERRIDE;
795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool CanCopy() OVERRIDE;
805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void CopyToPasteboard(NSPasteboard* pboard) OVERRIDE;
81d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  virtual bool ShouldEnableShowURL() OVERRIDE;
82d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  virtual void ShowURL() OVERRIDE;
835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnPaste() OVERRIDE;
845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool CanPasteAndGo() OVERRIDE;
855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual int GetPasteActionStringId() OVERRIDE;
865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnPasteAndGo() OVERRIDE;
875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnFrameChanged() OVERRIDE;
885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void ClosePopup() OVERRIDE;
895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnDidBeginEditing() OVERRIDE;
905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnBeforeChange() OVERRIDE;
915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnDidChange() OVERRIDE;
925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnDidEndEditing() OVERRIDE;
935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool OnDoCommandBySelector(SEL cmd) OVERRIDE;
945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnSetFocus(bool control_down) OVERRIDE;
955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnKillFocus() OVERRIDE;
962a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual void OnMouseDown(NSInteger button_number) OVERRIDE;
97d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  virtual bool ShouldSelectAllOnMouseDown() OVERRIDE;
985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Helper for LocationBarViewMac.  Optionally selects all in |field_|.
1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void FocusLocation(bool select_all);
1015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Helper to get the font to use in the field, exposed for the
1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // popup.
10423730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)  // The style parameter specifies the new style for the font, and is a
10523730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)  // bitmask of the values: BOLD, ITALIC and UNDERLINE (see ui/gfx/font.h).
10623730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)  static NSFont* GetFieldFont(int style);
1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // If |resource_id| has a PDF image which can be used, return it.
1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Otherwise return the PNG image from the resource bundle.
1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  static NSImage* ImageForResource(int resource_id);
1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Color used to draw suggest text.
1132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  static NSColor* SuggestTextColor();
1142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  AutocompleteTextField* field() const { return field_; }
1162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) private:
1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Called when the user hits backspace in |field_|.  Checks whether
1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // keyword search is being terminated.  Returns true if the
1205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // backspace should be intercepted (not forwarded on to the standard
1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // machinery).
1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool OnBackspacePressed();
1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns the field's currently selected range.  Only valid if the
1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // field has focus.
1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  NSRange GetSelectedRange() const;
1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns the field's currently marked range. Only valid if the field has
1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // focus.
1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  NSRange GetMarkedRange() const;
1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns true if |field_| is first-responder in the window.  Used
1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // in various DCHECKS to make sure code is running in appropriate
1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // situations.
1355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool IsFirstResponder() const;
1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // If |model_| believes it has focus, grab focus if needed and set
1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // the selection to |range|.  Otherwise does nothing.
1395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void SetSelectedRange(const NSRange range);
1405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Update the field with |display_text| and highlight the host and scheme (if
1425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // it's an URL or URL-fragment).  Resets any suggest text that may be present.
143a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  void SetText(const base::string16& display_text);
1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Internal implementation of SetText.  Does not reset the suggest text before
1465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // setting the display text.  Most callers should use |SetText()| instead.
147a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  void SetTextInternal(const base::string16& display_text);
1485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Update the field with |display_text| and set the selection.
150a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  void SetTextAndSelectedRange(const base::string16& display_text,
1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                               const NSRange range);
1525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Pass the current content of |field_| to SetText(), maintaining
1545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // any selection.  Named to be consistent with GTK and Windows,
1555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // though here we cannot really do the in-place operation they do.
1565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void EmphasizeURLComponents() OVERRIDE;
1575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Calculates text attributes according to |display_text| and applies them
1595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // to the given |as| object.
160a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  void ApplyTextAttributes(const base::string16& display_text,
1615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           NSMutableAttributedString* as);
1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Return the number of UTF-16 units in the current buffer, excluding the
1645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // suggested text.
1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual int GetOmniboxTextLength() const OVERRIDE;
1665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  NSUInteger GetTextLength() const;
1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns true if the caret is at the end of the content.
1695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool IsCaretAtEnd() const;
1705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1712a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  scoped_ptr<OmniboxPopupView> popup_view_;
1725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  AutocompleteTextField* field_;  // owned by tab controller
1745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Selection at the point where the user started using the
1765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // arrows to move around in the popup.
1775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  NSRange saved_temporary_selection_;
1785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Tracking state before and after a possible change for reporting
1805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // to model_.
1815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  NSRange selection_before_change_;
182a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  base::string16 text_before_change_;
1835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  NSRange marked_range_before_change_;
1845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Was delete pressed?
1865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool delete_was_pressed_;
1875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Was the delete key pressed with an empty selection at the end of the edit?
1895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool delete_at_end_pressed_;
1905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
191a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  base::string16 suggest_text_;
1922a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
193c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch  // State used to coalesce changes to text and selection to avoid drawing
194c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch  // transient state.
195c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch  bool in_coalesced_update_block_;
196c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch  bool do_coalesced_text_update_;
197c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch  base::string16 coalesced_text_update_;
198c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch  bool do_coalesced_range_update_;
199c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch  NSRange coalesced_range_update_;
200c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch
2015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(OmniboxViewMac);
2025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
2035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_
205