OLD | NEW |
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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "chrome/browser/autocomplete/autocomplete_match.h" | 13 #include "chrome/browser/autocomplete/autocomplete_match.h" |
14 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 14 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
15 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 15 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
16 #include "content/public/browser/notification_observer.h" | |
17 #include "ui/base/range/range.h" | 16 #include "ui/base/range/range.h" |
18 #include "ui/views/controls/textfield/textfield_controller.h" | 17 #include "ui/views/controls/textfield/textfield_controller.h" |
19 #include "ui/views/view.h" | 18 #include "ui/views/view.h" |
20 #include "webkit/glue/window_open_disposition.h" | 19 #include "webkit/glue/window_open_disposition.h" |
21 | 20 |
22 #if defined(OS_CHROMEOS) | 21 #if defined(OS_CHROMEOS) |
23 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 22 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
24 #endif | 23 #endif |
25 | 24 |
26 class AutocompleteEditController; | 25 class AutocompleteEditController; |
(...skipping 10 matching lines...) Expand all Loading... |
37 // The following features are not yet supported. | 36 // The following features are not yet supported. |
38 // | 37 // |
39 // LTR support. | 38 // LTR support. |
40 // Drag and drop behavior. | 39 // Drag and drop behavior. |
41 // Adjust paste behavior (should not autocomplete). | 40 // Adjust paste behavior (should not autocomplete). |
42 // Custom context menu for omnibox. | 41 // Custom context menu for omnibox. |
43 // Instant. | 42 // Instant. |
44 class OmniboxViewViews | 43 class OmniboxViewViews |
45 : public views::View, | 44 : public views::View, |
46 public OmniboxView, | 45 public OmniboxView, |
47 public content::NotificationObserver, | |
48 #if defined(OS_CHROMEOS) | 46 #if defined(OS_CHROMEOS) |
49 public | 47 public |
50 chromeos::input_method::InputMethodManager::CandidateWindowObserver, | 48 chromeos::input_method::InputMethodManager::CandidateWindowObserver, |
51 #endif | 49 #endif |
52 public views::TextfieldController { | 50 public views::TextfieldController { |
53 public: | 51 public: |
54 // The internal view class name. | 52 // The internal view class name. |
55 static const char kViewClassName[]; | 53 static const char kViewClassName[]; |
56 | 54 |
57 OmniboxViewViews(AutocompleteEditController* controller, | 55 OmniboxViewViews(AutocompleteEditController* controller, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 virtual CommandUpdater* GetCommandUpdater() OVERRIDE; | 135 virtual CommandUpdater* GetCommandUpdater() OVERRIDE; |
138 virtual void SetInstantSuggestion(const string16& input, | 136 virtual void SetInstantSuggestion(const string16& input, |
139 bool animate_to_complete) OVERRIDE; | 137 bool animate_to_complete) OVERRIDE; |
140 virtual string16 GetInstantSuggestion() const OVERRIDE; | 138 virtual string16 GetInstantSuggestion() const OVERRIDE; |
141 virtual int TextWidth() const OVERRIDE; | 139 virtual int TextWidth() const OVERRIDE; |
142 virtual bool IsImeComposing() const OVERRIDE; | 140 virtual bool IsImeComposing() const OVERRIDE; |
143 virtual int GetMaxEditWidth(int entry_width) const OVERRIDE; | 141 virtual int GetMaxEditWidth(int entry_width) const OVERRIDE; |
144 virtual views::View* AddToView(views::View* parent) OVERRIDE; | 142 virtual views::View* AddToView(views::View* parent) OVERRIDE; |
145 virtual int OnPerformDrop(const views::DropTargetEvent& event) OVERRIDE; | 143 virtual int OnPerformDrop(const views::DropTargetEvent& event) OVERRIDE; |
146 | 144 |
147 // content::NotificationObserver: | |
148 virtual void Observe(int type, | |
149 const content::NotificationSource& source, | |
150 const content::NotificationDetails& details) OVERRIDE; | |
151 | |
152 // views::TextfieldController: | 145 // views::TextfieldController: |
153 virtual void ContentsChanged(views::Textfield* sender, | 146 virtual void ContentsChanged(views::Textfield* sender, |
154 const string16& new_contents) OVERRIDE; | 147 const string16& new_contents) OVERRIDE; |
155 virtual bool HandleKeyEvent(views::Textfield* sender, | 148 virtual bool HandleKeyEvent(views::Textfield* sender, |
156 const views::KeyEvent& key_event) OVERRIDE; | 149 const views::KeyEvent& key_event) OVERRIDE; |
157 virtual void OnBeforeUserAction(views::Textfield* sender) OVERRIDE; | 150 virtual void OnBeforeUserAction(views::Textfield* sender) OVERRIDE; |
158 virtual void OnAfterUserAction(views::Textfield* sender) OVERRIDE; | 151 virtual void OnAfterUserAction(views::Textfield* sender) OVERRIDE; |
159 virtual void OnAfterCutOrCopy() OVERRIDE; | 152 virtual void OnAfterCutOrCopy() OVERRIDE; |
160 virtual void OnWriteDragData(ui::OSExchangeData* data) OVERRIDE; | 153 virtual void OnWriteDragData(ui::OSExchangeData* data) OVERRIDE; |
161 virtual void UpdateContextMenu(ui::SimpleMenuModel* menu_contents) OVERRIDE; | 154 virtual void UpdateContextMenu(ui::SimpleMenuModel* menu_contents) OVERRIDE; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 212 |
220 // True if the IME candidate window is open. When this is true, we want to | 213 // True if the IME candidate window is open. When this is true, we want to |
221 // avoid showing the popup. So far, the candidate window is detected only | 214 // avoid showing the popup. So far, the candidate window is detected only |
222 // on Chrome OS. | 215 // on Chrome OS. |
223 bool ime_candidate_window_open_; | 216 bool ime_candidate_window_open_; |
224 | 217 |
225 DISALLOW_COPY_AND_ASSIGN(OmniboxViewViews); | 218 DISALLOW_COPY_AND_ASSIGN(OmniboxViewViews); |
226 }; | 219 }; |
227 | 220 |
228 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_VIEWS_H_ | 221 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_VIEWS_H_ |
OLD | NEW |