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

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

Issue 10704074: "Paste and go" state was being calculated wrong on views (at least). Fix by making this calculatio… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 #ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_
6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_ 6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_
7 #pragma once 7 #pragma once
8 8
9 #include <atlbase.h> 9 #include <atlbase.h>
10 #include <atlapp.h> 10 #include <atlapp.h>
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 // Returns true if a drag a drop session was initiated by this edit. 139 // Returns true if a drag a drop session was initiated by this edit.
140 bool in_drag() const { return in_drag_; } 140 bool in_drag() const { return in_drag_; }
141 141
142 // Moves the selected text to the specified position. 142 // Moves the selected text to the specified position.
143 void MoveSelectedText(int new_position); 143 void MoveSelectedText(int new_position);
144 144
145 // Inserts the text at the specified position. 145 // Inserts the text at the specified position.
146 void InsertText(int position, const string16& text); 146 void InsertText(int position, const string16& text);
147 147
148 // Invokes CanPasteAndGo with the specified text, and if successful navigates
149 // to the appropriate URL. The behavior of this is the same as if the user
150 // typed in the specified text and pressed enter.
151 void PasteAndGo(const string16& text);
152
153 void set_force_hidden(bool force_hidden) { force_hidden_ = force_hidden; } 148 void set_force_hidden(bool force_hidden) { force_hidden_ = force_hidden; }
154 149
155 // Called before an accelerator is processed to give us a chance to override 150 // Called before an accelerator is processed to give us a chance to override
156 // it. 151 // it.
157 bool SkipDefaultKeyEventProcessing(const views::KeyEvent& event); 152 bool SkipDefaultKeyEventProcessing(const views::KeyEvent& event);
158 153
159 // Handler for external events passed in to us. The View that owns us may 154 // Handler for external events passed in to us. The View that owns us may
160 // send us events that we should treat as if they were events on us. 155 // send us events that we should treat as if they were events on us.
161 void HandleExternalMsg(UINT msg, UINT flags, const CPoint& screen_point); 156 void HandleExternalMsg(UINT msg, UINT flags, const CPoint& screen_point);
162 157
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 const CRect& paint_clip_rect); 354 const CRect& paint_clip_rect);
360 355
361 // Renders the drop highlight. 356 // Renders the drop highlight.
362 void DrawDropHighlight(HDC hdc, 357 void DrawDropHighlight(HDC hdc,
363 const CRect& client_rect, 358 const CRect& client_rect,
364 const CRect& paint_clip_rect); 359 const CRect& paint_clip_rect);
365 360
366 // Internally invoked whenever the text changes in some way. 361 // Internally invoked whenever the text changes in some way.
367 void TextChanged(); 362 void TextChanged();
368 363
369 // Determines whether the user can "paste and go", given the specified text.
370 bool CanPasteAndGo(const string16& text) const;
371
372 // Getter for the text_object_model_. Note that the pointer returned here is 364 // Getter for the text_object_model_. Note that the pointer returned here is
373 // only valid as long as the AutocompleteEdit is still alive. Also, if the 365 // only valid as long as the AutocompleteEdit is still alive. Also, if the
374 // underlying call fails, this may return NULL. 366 // underlying call fails, this may return NULL.
375 ITextDocument* GetTextObjectModel() const; 367 ITextDocument* GetTextObjectModel() const;
376 368
377 // Invoked during a mouse move. As necessary starts a drag and drop session. 369 // Invoked during a mouse move. As necessary starts a drag and drop session.
378 void StartDragIfNecessary(const CPoint& point); 370 void StartDragIfNecessary(const CPoint& point);
379 371
380 // Invoked during a mouse down. If the mouse location is over the selection 372 // Invoked during a mouse down. If the mouse location is over the selection
381 // this sets possible_drag_ to true to indicate a drag should start if the 373 // this sets possible_drag_ to true to indicate a drag should start if the
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 // Instance of accessibility information and handling. 523 // Instance of accessibility information and handling.
532 mutable base::win::ScopedComPtr<IAccessible> autocomplete_accessibility_; 524 mutable base::win::ScopedComPtr<IAccessible> autocomplete_accessibility_;
533 525
534 // The native view host. 526 // The native view host.
535 views::NativeViewHost* native_view_host_; 527 views::NativeViewHost* native_view_host_;
536 528
537 DISALLOW_COPY_AND_ASSIGN(OmniboxViewWin); 529 DISALLOW_COPY_AND_ASSIGN(OmniboxViewWin);
538 }; 530 };
539 531
540 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_ 532 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_views.cc ('k') | chrome/browser/ui/views/omnibox/omnibox_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698