| 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> |
| 11 #include <atlctrls.h> | 11 #include <atlctrls.h> |
| 12 #include <atlmisc.h> | 12 #include <atlmisc.h> |
| 13 #include <tom.h> // For ITextDocument, a COM interface to CRichEditCtrl. | 13 #include <tom.h> // For ITextDocument, a COM interface to CRichEditCtrl. |
| 14 | 14 |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/win/scoped_comptr.h" | 16 #include "base/win/scoped_comptr.h" |
| 17 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 17 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| 18 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 18 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
| 19 #include "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h" | 19 #include "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h" |
| 20 #include "ui/base/ime/win/tsf_event_router.h" | 20 #include "ui/base/ime/win/tsf_event_router.h" |
| 21 #include "ui/base/models/simple_menu_model.h" | 21 #include "ui/base/models/simple_menu_model.h" |
| 22 #include "ui/base/win/extra_sdk_defines.h" | 22 #include "ui/base/win/extra_sdk_defines.h" |
| 23 #include "ui/base/window_open_disposition.h" | 23 #include "ui/base/window_open_disposition.h" |
| 24 #include "ui/gfx/font.h" | 24 #include "ui/gfx/font_list.h" |
| 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 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 56 const CHARRANGE saved_selection_for_focus_change; | 56 const CHARRANGE saved_selection_for_focus_change; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 DECLARE_WND_SUPERCLASS(L"Chrome_OmniboxView", MSFTEDIT_CLASS); | 59 DECLARE_WND_SUPERCLASS(L"Chrome_OmniboxView", MSFTEDIT_CLASS); |
| 60 | 60 |
| 61 OmniboxViewWin(OmniboxEditController* controller, | 61 OmniboxViewWin(OmniboxEditController* controller, |
| 62 ToolbarModel* toolbar_model, | 62 ToolbarModel* toolbar_model, |
| 63 LocationBarView* parent_view, | 63 LocationBarView* parent_view, |
| 64 CommandUpdater* command_updater, | 64 CommandUpdater* command_updater, |
| 65 bool popup_window_mode, | 65 bool popup_window_mode, |
| 66 const gfx::Font& font, | 66 const gfx::FontList& font_list, |
| 67 int font_y_offset); | 67 int font_y_offset); |
| 68 ~OmniboxViewWin(); | 68 ~OmniboxViewWin(); |
| 69 | 69 |
| 70 // Gets the relative window for the specified native view. | 70 // Gets the relative window for the specified native view. |
| 71 static gfx::NativeView GetRelativeWindowForNativeView( | 71 static gfx::NativeView GetRelativeWindowForNativeView( |
| 72 gfx::NativeView edit_native_view); | 72 gfx::NativeView edit_native_view); |
| 73 | 73 |
| 74 views::View* parent_view() const; | 74 views::View* parent_view() const; |
| 75 | 75 |
| 76 // OmniboxView: | 76 // OmniboxView: |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 // there is no saved selection. | 463 // there is no saved selection. |
| 464 CHARRANGE saved_selection_for_focus_change_; | 464 CHARRANGE saved_selection_for_focus_change_; |
| 465 | 465 |
| 466 // Was the delete key pressed with an empty selection at the end of the edit? | 466 // Was the delete key pressed with an empty selection at the end of the edit? |
| 467 bool delete_at_end_pressed_; | 467 bool delete_at_end_pressed_; |
| 468 | 468 |
| 469 // The context menu for the edit. | 469 // The context menu for the edit. |
| 470 scoped_ptr<ui::SimpleMenuModel> context_menu_contents_; | 470 scoped_ptr<ui::SimpleMenuModel> context_menu_contents_; |
| 471 scoped_ptr<views::MenuRunner> context_menu_runner_; | 471 scoped_ptr<views::MenuRunner> context_menu_runner_; |
| 472 | 472 |
| 473 // Font we're using. We keep a reference to make sure the font supplied to | 473 // The font list to draw text in Omnibox. |
| 474 // the constructor doesn't go away before we do. | 474 gfx::FontList font_list_; |
| 475 gfx::Font font_; | |
| 476 | 475 |
| 477 // Metrics about the font, which we keep so we don't need to recalculate them | 476 // Metrics about the font, which we keep so we don't need to recalculate them |
| 478 // every time we paint. |font_y_adjustment_| is the number of pixels we need | 477 // every time we paint. |font_y_adjustment_| is the number of pixels we need |
| 479 // to shift the font vertically in order to make its baseline be at our | 478 // to shift the font vertically in order to make its baseline be at our |
| 480 // desired baseline in the edit. | 479 // desired baseline in the edit. |
| 481 int font_x_height_; | 480 int font_x_height_; |
| 482 int font_y_adjustment_; | 481 int font_y_adjustment_; |
| 483 | 482 |
| 484 // If true, indicates the mouse is down and if the mouse is moved enough we | 483 // If true, indicates the mouse is down and if the mouse is moved enough we |
| 485 // should start a drag. | 484 // should start a drag. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 // The native view host. | 516 // The native view host. |
| 518 views::NativeViewHost* native_view_host_; | 517 views::NativeViewHost* native_view_host_; |
| 519 | 518 |
| 520 // TSF related event router. | 519 // TSF related event router. |
| 521 scoped_ptr<ui::TSFEventRouter> tsf_event_router_; | 520 scoped_ptr<ui::TSFEventRouter> tsf_event_router_; |
| 522 | 521 |
| 523 DISALLOW_COPY_AND_ASSIGN(OmniboxViewWin); | 522 DISALLOW_COPY_AND_ASSIGN(OmniboxViewWin); |
| 524 }; | 523 }; |
| 525 | 524 |
| 526 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_ | 525 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_ |
| OLD | NEW |