| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TOOLBAR_TOOLBAR_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 | 13 |
| 14 class Browser; | 14 class Browser; |
| 15 |
| 16 namespace content { |
| 15 class NavigationController; | 17 class NavigationController; |
| 18 } |
| 16 | 19 |
| 17 namespace net { | 20 namespace net { |
| 18 class X509Certificate; | 21 class X509Certificate; |
| 19 } | 22 } |
| 20 | 23 |
| 21 // This class is the model used by the toolbar, location bar and autocomplete | 24 // This class is the model used by the toolbar, location bar and autocomplete |
| 22 // edit. It populates its states from the current navigation entry retrieved | 25 // edit. It populates its states from the current navigation entry retrieved |
| 23 // from the navigation controller returned by GetNavigationController(). | 26 // from the navigation controller returned by GetNavigationController(). |
| 24 class ToolbarModel { | 27 class ToolbarModel { |
| 25 public: | 28 public: |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 void set_input_in_progress(bool value) { input_in_progress_ = value; } | 66 void set_input_in_progress(bool value) { input_in_progress_ = value; } |
| 64 bool input_in_progress() const { return input_in_progress_; } | 67 bool input_in_progress() const { return input_in_progress_; } |
| 65 | 68 |
| 66 // Returns "<organization_name> [<country>]". | 69 // Returns "<organization_name> [<country>]". |
| 67 static string16 GetEVCertName(const net::X509Certificate& cert); | 70 static string16 GetEVCertName(const net::X509Certificate& cert); |
| 68 | 71 |
| 69 private: | 72 private: |
| 70 // Returns the navigation controller used to retrieve the navigation entry | 73 // Returns the navigation controller used to retrieve the navigation entry |
| 71 // from which the states are retrieved. | 74 // from which the states are retrieved. |
| 72 // If this returns NULL, default values are used. | 75 // If this returns NULL, default values are used. |
| 73 NavigationController* GetNavigationController() const; | 76 content::NavigationController* GetNavigationController() const; |
| 74 | 77 |
| 75 Browser* browser_; | 78 Browser* browser_; |
| 76 | 79 |
| 77 // Whether the text in the location bar is currently being edited. | 80 // Whether the text in the location bar is currently being edited. |
| 78 bool input_in_progress_; | 81 bool input_in_progress_; |
| 79 | 82 |
| 80 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarModel); | 83 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarModel); |
| 81 }; | 84 }; |
| 82 | 85 |
| 83 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ | 86 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ |
| OLD | NEW |