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_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 | 7 |
8 #include <atlbase.h> | 8 #include <atlbase.h> |
9 #include <atlapp.h> | 9 #include <atlapp.h> |
10 #include <atlcrack.h> | 10 #include <atlcrack.h> |
(...skipping 14 matching lines...) Expand all Loading... | |
25 | 25 |
26 class LocationBarView; | 26 class LocationBarView; |
27 class OmniboxPopupView; | 27 class OmniboxPopupView; |
28 | 28 |
29 namespace views { | 29 namespace views { |
30 class MenuRunner; | 30 class MenuRunner; |
31 class NativeViewHost; | 31 class NativeViewHost; |
32 class View; | 32 class View; |
33 } | 33 } |
34 | 34 |
35 namespace ui { | |
36 class TsfEventRouter; | |
37 } | |
38 | |
35 // Provides the implementation of an edit control with a drop-down | 39 // Provides the implementation of an edit control with a drop-down |
36 // autocomplete box. The box itself is implemented in autocomplete_popup.cc | 40 // autocomplete box. The box itself is implemented in autocomplete_popup.cc |
37 // This file implements the edit box and management for the popup. | 41 // This file implements the edit box and management for the popup. |
38 class OmniboxViewWin | 42 class OmniboxViewWin |
39 : public CWindowImpl<OmniboxViewWin, | 43 : public CWindowImpl<OmniboxViewWin, |
40 CRichEditCtrl, | 44 CRichEditCtrl, |
41 CWinTraits<WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL | | 45 CWinTraits<WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL | |
42 ES_NOHIDESEL> >, | 46 ES_NOHIDESEL> >, |
43 public CRichEditCommands<OmniboxViewWin>, | 47 public CRichEditCommands<OmniboxViewWin>, |
44 public ui::SimpleMenuModel::Delegate, | 48 public ui::SimpleMenuModel::Delegate, |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
377 int GetHorizontalMargin() const; | 381 int GetHorizontalMargin() const; |
378 | 382 |
379 // Returns the width in pixels needed to display |text|. | 383 // Returns the width in pixels needed to display |text|. |
380 int WidthNeededToDisplay(const string16& text) const; | 384 int WidthNeededToDisplay(const string16& text) const; |
381 | 385 |
382 // Real implementation of OnAfterPossibleChange() method. | 386 // Real implementation of OnAfterPossibleChange() method. |
383 // If |force_text_changed| is true, then the text_changed code will always be | 387 // If |force_text_changed| is true, then the text_changed code will always be |
384 // triggerred no matter if the text is actually changed or not. | 388 // triggerred no matter if the text is actually changed or not. |
385 bool OnAfterPossibleChangeInternal(bool force_text_changed); | 389 bool OnAfterPossibleChangeInternal(bool force_text_changed); |
386 | 390 |
391 // Callback function expected to be invoked when the text contents are | |
392 // updated by TSF. This callback should not be called when IMM32 is used. | |
393 void OnTextUpdatedByTsf(); | |
394 | |
395 // Callback function expected to be invoked when the number of currently | |
396 // candidate window opend is changed. This callback should not be called when | |
falken
2012/10/18 02:15:54
"currently opened candidate windows"
(if I unders
Seigo Nonaka
2012/10/18 10:02:23
Done.
| |
397 // IMM32 is used. | |
398 void OnCandidateWindowCountChangedByTsf(size_t window_count); | |
399 | |
387 // Common implementation for performing a drop on the edit view. | 400 // Common implementation for performing a drop on the edit view. |
388 int OnPerformDropImpl(const ui::DropTargetEvent& event, bool in_drag); | 401 int OnPerformDropImpl(const ui::DropTargetEvent& event, bool in_drag); |
389 | 402 |
390 // Whether to show the menu item for copying the URL. | 403 // Whether to show the menu item for copying the URL. |
391 bool ShouldEnableCopyURL() const; | 404 bool ShouldEnableCopyURL() const; |
392 void CopyURL(); | 405 void CopyURL(); |
393 | 406 |
394 // Handle of RichEdit dll. | 407 // Handle of RichEdit dll. |
395 static HMODULE loaded_library_module_; | 408 static HMODULE loaded_library_module_; |
396 | 409 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
504 // This contains the scheme char start and stop indexes that should be | 517 // This contains the scheme char start and stop indexes that should be |
505 // stricken-out when displaying an insecure scheme. | 518 // stricken-out when displaying an insecure scheme. |
506 url_parse::Component insecure_scheme_component_; | 519 url_parse::Component insecure_scheme_component_; |
507 | 520 |
508 // Instance of accessibility information and handling. | 521 // Instance of accessibility information and handling. |
509 mutable base::win::ScopedComPtr<IAccessible> autocomplete_accessibility_; | 522 mutable base::win::ScopedComPtr<IAccessible> autocomplete_accessibility_; |
510 | 523 |
511 // The native view host. | 524 // The native view host. |
512 views::NativeViewHost* native_view_host_; | 525 views::NativeViewHost* native_view_host_; |
513 | 526 |
527 // TSF related event router. | |
528 scoped_refptr<ui::TsfEventRouter> tsf_event_router_; | |
529 | |
530 // Weak pointer factory used for making callbacks. | |
531 base::WeakPtrFactory<OmniboxViewWin> weak_ptr_factory_; | |
532 | |
514 DISALLOW_COPY_AND_ASSIGN(OmniboxViewWin); | 533 DISALLOW_COPY_AND_ASSIGN(OmniboxViewWin); |
515 }; | 534 }; |
516 | 535 |
517 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_ | 536 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_ |
OLD | NEW |