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

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

Issue 2731123002: Fix some issues with OmniboxViewViews' use of OmniboxClient. (Closed)
Patch Set: Resync Created 3 years, 9 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 #ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_VIEWS_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_VIEWS_H_
6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_VIEWS_H_ 6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_VIEWS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 10 matching lines...) Expand all
21 #include "ui/views/controls/textfield/textfield.h" 21 #include "ui/views/controls/textfield/textfield.h"
22 #include "ui/views/controls/textfield/textfield_controller.h" 22 #include "ui/views/controls/textfield/textfield_controller.h"
23 23
24 #if defined(OS_CHROMEOS) 24 #if defined(OS_CHROMEOS)
25 #include "ui/base/ime/chromeos/input_method_manager.h" 25 #include "ui/base/ime/chromeos/input_method_manager.h"
26 #endif 26 #endif
27 27
28 class CommandUpdater; 28 class CommandUpdater;
29 class LocationBarView; 29 class LocationBarView;
30 class OmniboxPopupView; 30 class OmniboxPopupView;
31 class Profile;
32 31
33 namespace content { 32 namespace content {
34 class WebContents; 33 class WebContents;
35 } // namespace content 34 } // namespace content
36 35
37 namespace gfx { 36 namespace gfx {
38 class RenderText; 37 class RenderText;
39 } 38 }
40 39
41 namespace ui { 40 namespace ui {
42 class OSExchangeData; 41 class OSExchangeData;
43 } // namespace ui 42 } // namespace ui
44 43
45 // Views-implementation of OmniboxView. 44 // Views-implementation of OmniboxView.
46 class OmniboxViewViews 45 class OmniboxViewViews
47 : public OmniboxView, 46 : public OmniboxView,
48 public views::Textfield, 47 public views::Textfield,
49 #if defined(OS_CHROMEOS) 48 #if defined(OS_CHROMEOS)
50 public 49 public
51 chromeos::input_method::InputMethodManager::CandidateWindowObserver, 50 chromeos::input_method::InputMethodManager::CandidateWindowObserver,
52 #endif 51 #endif
53 public views::TextfieldController { 52 public views::TextfieldController {
54 public: 53 public:
55 // The internal view class name. 54 // The internal view class name.
56 static const char kViewClassName[]; 55 static const char kViewClassName[];
57 56
58 OmniboxViewViews(OmniboxEditController* controller, 57 OmniboxViewViews(OmniboxEditController* controller,
59 Profile* profile, 58 std::unique_ptr<OmniboxClient> client,
Mark P 2017/03/08 05:43:38 nit: please add appropriate include or forward dec
Peter Kasting 2017/03/08 11:44:57 Done, though in the absence of formal IWYU tooling
60 CommandUpdater* command_updater, 59 CommandUpdater* command_updater,
61 bool popup_window_mode, 60 bool popup_window_mode,
62 LocationBarView* location_bar, 61 LocationBarView* location_bar,
63 const gfx::FontList& font_list); 62 const gfx::FontList& font_list);
64 ~OmniboxViewViews() override; 63 ~OmniboxViewViews() override;
65 64
66 // Initialize, create the underlying views, etc. 65 // Initialize, create the underlying views, etc.
67 void Init(); 66 void Init();
68 67
69 // Exposes the RenderText for tests. 68 // Exposes the RenderText for tests.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 void OnAfterUserAction(views::Textfield* sender) override; 192 void OnAfterUserAction(views::Textfield* sender) override;
194 void OnAfterCutOrCopy(ui::ClipboardType clipboard_type) override; 193 void OnAfterCutOrCopy(ui::ClipboardType clipboard_type) override;
195 void OnWriteDragData(ui::OSExchangeData* data) override; 194 void OnWriteDragData(ui::OSExchangeData* data) override;
196 void OnGetDragOperationsForTextfield(int* drag_operations) override; 195 void OnGetDragOperationsForTextfield(int* drag_operations) override;
197 void AppendDropFormats( 196 void AppendDropFormats(
198 int* formats, 197 int* formats,
199 std::set<ui::Clipboard::FormatType>* format_types) override; 198 std::set<ui::Clipboard::FormatType>* format_types) override;
200 int OnDrop(const ui::OSExchangeData& data) override; 199 int OnDrop(const ui::OSExchangeData& data) override;
201 void UpdateContextMenu(ui::SimpleMenuModel* menu_contents) override; 200 void UpdateContextMenu(ui::SimpleMenuModel* menu_contents) override;
202 201
203 Profile* profile_;
204
205 // When true, the location bar view is read only and also is has a slightly 202 // When true, the location bar view is read only and also is has a slightly
206 // different presentation (smaller font size). This is used for popups. 203 // different presentation (smaller font size). This is used for popups.
207 bool popup_window_mode_; 204 bool popup_window_mode_;
208 205
209 std::unique_ptr<OmniboxPopupView> popup_view_; 206 std::unique_ptr<OmniboxPopupView> popup_view_;
210 207
211 security_state::SecurityLevel security_level_; 208 security_state::SecurityLevel security_level_;
212 209
213 // Selection persisted across temporary text changes, like popup suggestions. 210 // Selection persisted across temporary text changes, like popup suggestions.
214 gfx::Range saved_temporary_selection_; 211 gfx::Range saved_temporary_selection_;
(...skipping 29 matching lines...) Expand all
244 bool select_all_on_gesture_tap_; 241 bool select_all_on_gesture_tap_;
245 242
246 // The time of the first character insert operation that has not yet been 243 // The time of the first character insert operation that has not yet been
247 // painted. Used to measure omnibox responsiveness with a histogram. 244 // painted. Used to measure omnibox responsiveness with a histogram.
248 base::TimeTicks insert_char_time_; 245 base::TimeTicks insert_char_time_;
249 246
250 DISALLOW_COPY_AND_ASSIGN(OmniboxViewViews); 247 DISALLOW_COPY_AND_ASSIGN(OmniboxViewViews);
251 }; 248 };
252 249
253 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_VIEWS_H_ 250 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_VIEWS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698