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