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 // This file defines the interface class OmniboxView. Each toolkit will | 5 // This file defines the interface class OmniboxView. Each toolkit will |
6 // implement the edit view differently, so that code is inherently platform | 6 // implement the edit view differently, so that code is inherently platform |
7 // specific. However, the OmniboxEditModel needs to do some communication with | 7 // specific. However, the OmniboxEditModel needs to do some communication with |
8 // the view. Since the model is shared between platforms, we need to define an | 8 // the view. Since the model is shared between platforms, we need to define an |
9 // interface that all view implementations will share. | 9 // interface that all view implementations will share. |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... | |
37 public: | 37 public: |
38 virtual ~OmniboxView(); | 38 virtual ~OmniboxView(); |
39 | 39 |
40 // Used by the automation system for getting at the model from the view. | 40 // Used by the automation system for getting at the model from the view. |
41 OmniboxEditModel* model() { return model_.get(); } | 41 OmniboxEditModel* model() { return model_.get(); } |
42 const OmniboxEditModel* model() const { return model_.get(); } | 42 const OmniboxEditModel* model() const { return model_.get(); } |
43 | 43 |
44 CommandUpdater* command_updater() { return command_updater_; } | 44 CommandUpdater* command_updater() { return command_updater_; } |
45 const CommandUpdater* command_updater() const { return command_updater_; } | 45 const CommandUpdater* command_updater() const { return command_updater_; } |
46 | 46 |
47 // Handle mouse release events concerning the origin chip. | |
48 void HandleOriginChipMouseRelease(); | |
49 | |
50 // Shared cross-platform focus handling. | 47 // Shared cross-platform focus handling. |
51 void OnDidKillFocus(); | 48 void OnDidKillFocus(); |
52 | 49 |
53 // For use when switching tabs, this saves the current state onto the tab so | 50 // For use when switching tabs, this saves the current state onto the tab so |
54 // that it can be restored during a later call to Update(). | 51 // that it can be restored during a later call to Update(). |
55 virtual void SaveStateToTab(content::WebContents* tab) = 0; | 52 virtual void SaveStateToTab(content::WebContents* tab) = 0; |
56 | 53 |
57 // Called when the window's active tab changes. | 54 // Called when the window's active tab changes. |
58 virtual void OnTabChanged(const content::WebContents* web_contents) = 0; | 55 virtual void OnTabChanged(const content::WebContents* web_contents) = 0; |
59 | 56 |
60 // Called when any relevant state changes other than changing tabs. | 57 // Called when any relevant state changes other than changing tabs. |
61 virtual void Update() = 0; | 58 virtual void Update() = 0; |
62 | 59 |
63 // Updates the placeholder text with the value of GetHintText() if the | 60 // Updates the placeholder text with the value of GetHintText() if possible. |
Justin Donnelly
2014/11/21 19:15:24
To avoid ambiguity, suggest replacing "if possible
groby-ooo-7-16
2014/12/02 18:40:10
Slightly different wording, omitting "field trial"
| |
64 // origin chip is enabled. | |
65 virtual void UpdatePlaceholderText() = 0; | 61 virtual void UpdatePlaceholderText() = 0; |
66 | 62 |
67 // Asks the browser to load the specified match, using the supplied | 63 // Asks the browser to load the specified match, using the supplied |
68 // disposition. |alternate_nav_url|, if non-empty, contains the | 64 // disposition. |alternate_nav_url|, if non-empty, contains the |
69 // alternate navigation URL for for this match. See comments on | 65 // alternate navigation URL for for this match. See comments on |
70 // AutocompleteResult::GetAlternateNavURL(). | 66 // AutocompleteResult::GetAlternateNavURL(). |
71 // | 67 // |
72 // |pasted_text| should only be set if this call is due to a | 68 // |pasted_text| should only be set if this call is due to a |
73 // Paste-And-Go/Search action. | 69 // Paste-And-Go/Search action. |
74 // | 70 // |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
288 // |model_| can be NULL in tests. | 284 // |model_| can be NULL in tests. |
289 scoped_ptr<OmniboxEditModel> model_; | 285 scoped_ptr<OmniboxEditModel> model_; |
290 OmniboxEditController* controller_; | 286 OmniboxEditController* controller_; |
291 | 287 |
292 // The object that handles additional command functionality exposed on the | 288 // The object that handles additional command functionality exposed on the |
293 // edit, such as invoking the keyword editor. | 289 // edit, such as invoking the keyword editor. |
294 CommandUpdater* command_updater_; | 290 CommandUpdater* command_updater_; |
295 }; | 291 }; |
296 | 292 |
297 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_ | 293 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_ |
OLD | NEW |