OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/browser/autocomplete/autocomplete_edit_view_win.h" | 5 #include "chrome/browser/autocomplete/autocomplete_edit_view_win.h" |
6 | 6 |
7 #include <locale> | 7 #include <locale> |
8 | 8 |
9 #include "app/gfx/canvas.h" | 9 #include "app/gfx/canvas.h" |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 // * The user is trying to compose something in an IME | 699 // * The user is trying to compose something in an IME |
700 CHARRANGE sel; | 700 CHARRANGE sel; |
701 GetSel(sel); | 701 GetSel(sel); |
702 model_->StartAutocomplete((sel.cpMax < GetTextLength()) || ime_composing); | 702 model_->StartAutocomplete((sel.cpMax < GetTextLength()) || ime_composing); |
703 } | 703 } |
704 | 704 |
705 void AutocompleteEditViewWin::ClosePopup() { | 705 void AutocompleteEditViewWin::ClosePopup() { |
706 popup_view_->GetModel()->StopAutocomplete(); | 706 popup_view_->GetModel()->StopAutocomplete(); |
707 } | 707 } |
708 | 708 |
| 709 void AutocompleteEditViewWin::SetFocus() { |
| 710 ::SetFocus(m_hWnd); |
| 711 } |
| 712 |
709 IAccessible* AutocompleteEditViewWin::GetIAccessible() { | 713 IAccessible* AutocompleteEditViewWin::GetIAccessible() { |
710 if (!autocomplete_accessibility_) { | 714 if (!autocomplete_accessibility_) { |
711 CComObject<AutocompleteAccessibility>* accessibility = NULL; | 715 CComObject<AutocompleteAccessibility>* accessibility = NULL; |
712 if (!SUCCEEDED(CComObject<AutocompleteAccessibility>::CreateInstance( | 716 if (!SUCCEEDED(CComObject<AutocompleteAccessibility>::CreateInstance( |
713 &accessibility)) || !accessibility) | 717 &accessibility)) || !accessibility) |
714 return NULL; | 718 return NULL; |
715 | 719 |
716 // Wrap the created object in a smart pointer so it won't leak. | 720 // Wrap the created object in a smart pointer so it won't leak. |
717 ScopedComPtr<IAccessible> accessibility_comptr(accessibility); | 721 ScopedComPtr<IAccessible> accessibility_comptr(accessibility); |
718 if (!SUCCEEDED(accessibility->Initialize(this))) | 722 if (!SUCCEEDED(accessibility->Initialize(this))) |
(...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2373 context_menu_contents_->AddItemWithStringId(IDS_PASTE_AND_GO, | 2377 context_menu_contents_->AddItemWithStringId(IDS_PASTE_AND_GO, |
2374 IDS_PASTE_AND_GO); | 2378 IDS_PASTE_AND_GO); |
2375 context_menu_contents_->AddSeparator(); | 2379 context_menu_contents_->AddSeparator(); |
2376 context_menu_contents_->AddItemWithStringId(IDS_SELECT_ALL, IDS_SELECT_ALL); | 2380 context_menu_contents_->AddItemWithStringId(IDS_SELECT_ALL, IDS_SELECT_ALL); |
2377 context_menu_contents_->AddSeparator(); | 2381 context_menu_contents_->AddSeparator(); |
2378 context_menu_contents_->AddItemWithStringId(IDS_EDIT_SEARCH_ENGINES, | 2382 context_menu_contents_->AddItemWithStringId(IDS_EDIT_SEARCH_ENGINES, |
2379 IDS_EDIT_SEARCH_ENGINES); | 2383 IDS_EDIT_SEARCH_ENGINES); |
2380 } | 2384 } |
2381 context_menu_.reset(new views::Menu2(context_menu_contents_.get())); | 2385 context_menu_.reset(new views::Menu2(context_menu_contents_.get())); |
2382 } | 2386 } |
OLD | NEW |