| 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 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 class CommandUpdater; | 29 class CommandUpdater; |
| 30 class LocationBarView; | 30 class LocationBarView; |
| 31 class OmniboxPopupView; | 31 class OmniboxPopupView; |
| 32 class Profile; | 32 class Profile; |
| 33 | 33 |
| 34 namespace content { | 34 namespace content { |
| 35 class WebContents; | 35 class WebContents; |
| 36 } // namespace content | 36 } // namespace content |
| 37 | 37 |
| 38 namespace gfx { | |
| 39 class RenderText; | |
| 40 } | |
| 41 | |
| 42 namespace ui { | 38 namespace ui { |
| 43 class OSExchangeData; | 39 class OSExchangeData; |
| 44 } // namespace ui | 40 } // namespace ui |
| 45 | 41 |
| 46 // Views-implementation of OmniboxView. | 42 // Views-implementation of OmniboxView. |
| 47 class OmniboxViewViews | 43 class OmniboxViewViews |
| 48 : public OmniboxView, | 44 : public OmniboxView, |
| 49 public views::Textfield, | 45 public views::Textfield, |
| 50 #if defined(OS_CHROMEOS) | 46 #if defined(OS_CHROMEOS) |
| 51 public | 47 public |
| 52 chromeos::input_method::InputMethodManager::CandidateWindowObserver, | 48 chromeos::input_method::InputMethodManager::CandidateWindowObserver, |
| 53 #endif | 49 #endif |
| 54 public views::TextfieldController { | 50 public views::TextfieldController { |
| 55 public: | 51 public: |
| 56 // The internal view class name. | 52 // The internal view class name. |
| 57 static const char kViewClassName[]; | 53 static const char kViewClassName[]; |
| 58 | 54 |
| 59 OmniboxViewViews(OmniboxEditController* controller, | 55 OmniboxViewViews(OmniboxEditController* controller, |
| 60 Profile* profile, | 56 Profile* profile, |
| 61 CommandUpdater* command_updater, | 57 CommandUpdater* command_updater, |
| 62 bool popup_window_mode, | 58 bool popup_window_mode, |
| 63 LocationBarView* location_bar, | 59 LocationBarView* location_bar, |
| 64 const gfx::FontList& font_list); | 60 const gfx::FontList& font_list); |
| 65 ~OmniboxViewViews() override; | 61 ~OmniboxViewViews() override; |
| 66 | 62 |
| 67 // Initialize, create the underlying views, etc. | 63 // Initialize, create the underlying views, etc. |
| 68 void Init(); | 64 void Init(); |
| 69 | 65 |
| 70 // Exposes the RenderText for tests. | |
| 71 #if defined(UNIT_TEST) | |
| 72 gfx::RenderText* GetRenderText() { | |
| 73 return views::Textfield::GetRenderText(); | |
| 74 } | |
| 75 #endif | |
| 76 | |
| 77 // For use when switching tabs, this saves the current state onto the tab so | 66 // For use when switching tabs, this saves the current state onto the tab so |
| 78 // that it can be restored during a later call to Update(). | 67 // that it can be restored during a later call to Update(). |
| 79 void SaveStateToTab(content::WebContents* tab); | 68 void SaveStateToTab(content::WebContents* tab); |
| 80 | 69 |
| 81 // Called when the window's active tab changes. | 70 // Called when the window's active tab changes. |
| 82 void OnTabChanged(const content::WebContents* web_contents); | 71 void OnTabChanged(const content::WebContents* web_contents); |
| 83 | 72 |
| 84 // Called to clear the saved state for |web_contents|. | 73 // Called to clear the saved state for |web_contents|. |
| 85 void ResetTabState(content::WebContents* web_contents); | 74 void ResetTabState(content::WebContents* web_contents); |
| 86 | 75 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 // painted. Used to measure omnibox responsiveness with a histogram. | 241 // painted. Used to measure omnibox responsiveness with a histogram. |
| 253 base::TimeTicks insert_char_time_; | 242 base::TimeTicks insert_char_time_; |
| 254 | 243 |
| 255 // Used to bind callback functions to this object. | 244 // Used to bind callback functions to this object. |
| 256 base::WeakPtrFactory<OmniboxViewViews> weak_ptr_factory_; | 245 base::WeakPtrFactory<OmniboxViewViews> weak_ptr_factory_; |
| 257 | 246 |
| 258 DISALLOW_COPY_AND_ASSIGN(OmniboxViewViews); | 247 DISALLOW_COPY_AND_ASSIGN(OmniboxViewViews); |
| 259 }; | 248 }; |
| 260 | 249 |
| 261 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_VIEWS_H_ | 250 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_VIEWS_H_ |
| OLD | NEW |