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

Side by Side Diff: chrome/browser/ui/omnibox/omnibox_view.h

Issue 20501002: Adds paste function to searchbox api and handles paste event on fakebox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adds optional text param to paste. Also adds drop behavior to fakebox. Created 7 years, 4 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
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 // This file defines the interface class OmniboxView. Each toolkit will 5 // This file defines the interface class OmniboxView. Each toolkit will
6 // implement the edit view differently, so that code is inherently platform 6 // implement the edit view differently, so that code is inherently platform
7 // specific. However, the OmniboxEditModel needs to do some communication with 7 // specific. However, the OmniboxEditModel needs to do some communication with
8 // the view. Since the model is shared between platforms, we need to define an 8 // the view. Since the model is shared between platforms, we need to define an
9 // interface that all view implementations will share. 9 // interface that all view implementations will share.
10 10
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 virtual int GetMaxEditWidth(int entry_width) const = 0; 224 virtual int GetMaxEditWidth(int entry_width) const = 0;
225 225
226 // Adds the autocomplete edit view to view hierarchy and 226 // Adds the autocomplete edit view to view hierarchy and
227 // returns the views::View of the edit view. 227 // returns the views::View of the edit view.
228 virtual views::View* AddToView(views::View* parent) = 0; 228 virtual views::View* AddToView(views::View* parent) = 0;
229 229
230 // Performs the drop of a drag and drop operation on the view. 230 // Performs the drop of a drag and drop operation on the view.
231 virtual int OnPerformDrop(const ui::DropTargetEvent& event) = 0; 231 virtual int OnPerformDrop(const ui::DropTargetEvent& event) = 0;
232 #endif 232 #endif
233 233
234 // Returns a string with any leading javascript schemas stripped from the 234 // Returns a string with any leading javascript schemas stripped from the
Peter Kasting 2013/08/06 21:55:13 Nit: While you're here, improve this comment: Ret
jfweitz 2013/08/09 02:37:41 Done.
235 // input text. 235 // input text.
236 static string16 StripJavascriptSchemas(const string16& text); 236 static string16 StripJavascriptSchemas(const string16& text);
237 237
238 // Returns a string after stripping out any leading javascript schemas and
239 // collapsing whitespace from the input text.
Peter Kasting 2013/08/06 21:55:13 This needs to say more about what's happening. Ba
jfweitz 2013/08/09 02:37:41 Done.
240 static string16 SanitizeTextForPaste(const string16& text);
241
238 // Returns the current clipboard contents as a string that can be pasted in. 242 // Returns the current clipboard contents as a string that can be pasted in.
239 // In addition to just getting CF_UNICODETEXT out, this can also extract URLs 243 // In addition to just getting CF_UNICODETEXT out, this can also extract URLs
240 // from bookmarks on the clipboard. 244 // from bookmarks on the clipboard.
241 static string16 GetClipboardText(); 245 static string16 GetClipboardText();
242 246
243 protected: 247 protected:
244 OmniboxView(Profile* profile, 248 OmniboxView(Profile* profile,
245 OmniboxEditController* controller, 249 OmniboxEditController* controller,
246 ToolbarModel* toolbar_model, 250 ToolbarModel* toolbar_model,
247 CommandUpdater* command_updater); 251 CommandUpdater* command_updater);
(...skipping 18 matching lines...) Expand all
266 scoped_ptr<OmniboxEditModel> model_; 270 scoped_ptr<OmniboxEditModel> model_;
267 OmniboxEditController* controller_; 271 OmniboxEditController* controller_;
268 ToolbarModel* toolbar_model_; 272 ToolbarModel* toolbar_model_;
269 273
270 // The object that handles additional command functionality exposed on the 274 // The object that handles additional command functionality exposed on the
271 // edit, such as invoking the keyword editor. 275 // edit, such as invoking the keyword editor.
272 CommandUpdater* command_updater_; 276 CommandUpdater* command_updater_;
273 }; 277 };
274 278
275 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_ 279 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698