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

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

Issue 11141019: Re-enable CJK omnibox suggest on Metro UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address comments Created 8 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_view_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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>
11 #include <atlctrls.h> 11 #include <atlctrls.h>
12 #include <atlmisc.h> 12 #include <atlmisc.h>
13 #include <peninputpanel.h> 13 #include <peninputpanel.h>
14 #include <tom.h> // For ITextDocument, a COM interface to CRichEditCtrl. 14 #include <tom.h> // For ITextDocument, a COM interface to CRichEditCtrl.
15 15
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
17 #include "base/win/scoped_comptr.h" 17 #include "base/win/scoped_comptr.h"
18 #include "chrome/browser/ui/omnibox/omnibox_view.h" 18 #include "chrome/browser/ui/omnibox/omnibox_view.h"
19 #include "chrome/browser/ui/toolbar/toolbar_model.h" 19 #include "chrome/browser/ui/toolbar/toolbar_model.h"
20 #include "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h" 20 #include "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h"
21 #include "ui/base/ime/win/tsf_event_router.h"
21 #include "ui/base/models/simple_menu_model.h" 22 #include "ui/base/models/simple_menu_model.h"
22 #include "ui/base/win/extra_sdk_defines.h" 23 #include "ui/base/win/extra_sdk_defines.h"
23 #include "ui/gfx/font.h" 24 #include "ui/gfx/font.h"
24 #include "webkit/glue/window_open_disposition.h" 25 #include "webkit/glue/window_open_disposition.h"
25 26
26 class LocationBarView; 27 class LocationBarView;
27 class OmniboxPopupView; 28 class OmniboxPopupView;
28 29
29 namespace views { 30 namespace views {
30 class MenuRunner; 31 class MenuRunner;
31 class NativeViewHost; 32 class NativeViewHost;
32 class View; 33 class View;
33 } 34 }
34 35
35 // Provides the implementation of an edit control with a drop-down 36 // Provides the implementation of an edit control with a drop-down
36 // autocomplete box. The box itself is implemented in autocomplete_popup.cc 37 // autocomplete box. The box itself is implemented in autocomplete_popup.cc
37 // This file implements the edit box and management for the popup. 38 // This file implements the edit box and management for the popup.
38 class OmniboxViewWin 39 class OmniboxViewWin
39 : public CWindowImpl<OmniboxViewWin, 40 : public CWindowImpl<OmniboxViewWin,
40 CRichEditCtrl, 41 CRichEditCtrl,
41 CWinTraits<WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL | 42 CWinTraits<WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL |
42 ES_NOHIDESEL> >, 43 ES_NOHIDESEL> >,
43 public CRichEditCommands<OmniboxViewWin>, 44 public CRichEditCommands<OmniboxViewWin>,
44 public ui::SimpleMenuModel::Delegate, 45 public ui::SimpleMenuModel::Delegate,
46 public ui::TsfEventRouter::Observer,
45 public OmniboxView { 47 public OmniboxView {
46 public: 48 public:
47 struct State { 49 struct State {
48 State(const CHARRANGE& selection, 50 State(const CHARRANGE& selection,
49 const CHARRANGE& saved_selection_for_focus_change) 51 const CHARRANGE& saved_selection_for_focus_change)
50 : selection(selection), 52 : selection(selection),
51 saved_selection_for_focus_change(saved_selection_for_focus_change) { 53 saved_selection_for_focus_change(saved_selection_for_focus_change) {
52 } 54 }
53 55
54 const CHARRANGE selection; 56 const CHARRANGE selection;
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 // click. Sadly, we need to clip slightly differently in this case. 324 // click. Sadly, we need to clip slightly differently in this case.
323 LONG ClipXCoordToVisibleText(LONG x, bool is_triple_click) const; 325 LONG ClipXCoordToVisibleText(LONG x, bool is_triple_click) const;
324 326
325 virtual int GetOmniboxTextLength() const OVERRIDE; 327 virtual int GetOmniboxTextLength() const OVERRIDE;
326 328
327 // Parses the contents of the control for the scheme and the host name. 329 // Parses the contents of the control for the scheme and the host name.
328 // Highlights the scheme in green or red depending on it security level. 330 // Highlights the scheme in green or red depending on it security level.
329 // If a host name is found, it makes it visually stronger. 331 // If a host name is found, it makes it visually stronger.
330 virtual void EmphasizeURLComponents() OVERRIDE; 332 virtual void EmphasizeURLComponents() OVERRIDE;
331 333
334 // TsfEventRouter::Observer
335 virtual void OnTextUpdated() OVERRIDE;
336 virtual void OnCandidateWindowCountChanged(size_t window_count) OVERRIDE;
337
332 // Erases the portion of the selection in the font's y-adjustment area. For 338 // Erases the portion of the selection in the font's y-adjustment area. For
333 // some reason the edit draws the selection rect here even though it's not 339 // some reason the edit draws the selection rect here even though it's not
334 // part of the font. 340 // part of the font.
335 void EraseTopOfSelection(CDC* dc, 341 void EraseTopOfSelection(CDC* dc,
336 const CRect& client_rect, 342 const CRect& client_rect,
337 const CRect& paint_clip_rect); 343 const CRect& paint_clip_rect);
338 344
339 // Draws a slash across the scheme if desired. 345 // Draws a slash across the scheme if desired.
340 void DrawSlashForInsecureScheme(HDC hdc, 346 void DrawSlashForInsecureScheme(HDC hdc,
341 const CRect& client_rect, 347 const CRect& client_rect,
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 // This contains the scheme char start and stop indexes that should be 510 // This contains the scheme char start and stop indexes that should be
505 // stricken-out when displaying an insecure scheme. 511 // stricken-out when displaying an insecure scheme.
506 url_parse::Component insecure_scheme_component_; 512 url_parse::Component insecure_scheme_component_;
507 513
508 // Instance of accessibility information and handling. 514 // Instance of accessibility information and handling.
509 mutable base::win::ScopedComPtr<IAccessible> autocomplete_accessibility_; 515 mutable base::win::ScopedComPtr<IAccessible> autocomplete_accessibility_;
510 516
511 // The native view host. 517 // The native view host.
512 views::NativeViewHost* native_view_host_; 518 views::NativeViewHost* native_view_host_;
513 519
520 // TSF related event router.
521 scoped_refptr<ui::TsfEventRouter> tsf_event_router_;
522
514 DISALLOW_COPY_AND_ASSIGN(OmniboxViewWin); 523 DISALLOW_COPY_AND_ASSIGN(OmniboxViewWin);
515 }; 524 };
516 525
517 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_ 526 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698