diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-10 20:17:55 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-10 20:17:55 +0000 |
commit | 3954c3a76994f8e3a8eec65f4d90580ba8ab0e80 (patch) | |
tree | 638d7ff635e7bda3f037785a2096f36ed7bb21c7 /chrome/browser/search_engines/template_url.h | |
parent | 6fae79736f73e541b0ec3951adb1c4f83ba7428e (diff) | |
download | chromium_src-3954c3a76994f8e3a8eec65f4d90580ba8ab0e80.zip chromium_src-3954c3a76994f8e3a8eec65f4d90580ba8ab0e80.tar.gz chromium_src-3954c3a76994f8e3a8eec65f4d90580ba8ab0e80.tar.bz2 |
More misc. cleanups to minimize future refactoring diffs:
* Fix indentation
* Slightly more const-correct TemplateURLData functions
* Use EXPECT_XXX() where possible, but ASSERT_XXX() to avoid crashes on expectation failure
* Remove unneeded #include
* Simplify AlternateErrorPageTabObserver slightly by having constructor take a Profile
* Shorter/simpler code
* Fix ordering in some places to be more consistent (e.g. matching member declaration order)
* Add some DCHECK()s to make more explicit some conditions that will become important later
Also, template_url_service.cc has some functional changes:
* GetTemplateURLForXXX() functions now return correct values when asked for the default search URL before the model has successfully loaded. I wound up needing this later to fix some case, but I forget what now; the change seems more correct anyway.
* Similarly, UnregisterExtensionKeyword() now works correctly if called before loading has finished
* RegisterExtensionKeyword() now does nothing when there's already a keyword for that extension, as the comments in the header claim. I'd think this wouldn't actually matter in normal use as I think extension upgrades first unregister the old extension? (I don't remember if I checked that, though)
* Don't try to set an extension keyword as default -- this would be a bad UX as these are inherently async. I don't think this should have been possible anyway except maybe if there was some kind of unintentional overlap between extensions and policy??
* Don't try to save extension keywords to disk or sync them (as the extension system should be responsible for registering them if necessary on startup in both these cases). We already avoided syncing these, I just added checks in more places; I no longer recall if we had code to avoid persisting these to disk, I don't seem to see any at the moment. (sky?)
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10033017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131619 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines/template_url.h')
-rw-r--r-- | chrome/browser/search_engines/template_url.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/chrome/browser/search_engines/template_url.h b/chrome/browser/search_engines/template_url.h index 3e56c73..f7d8bc0 100644 --- a/chrome/browser/search_engines/template_url.h +++ b/chrome/browser/search_engines/template_url.h @@ -251,7 +251,7 @@ struct TemplateURLData { string16 short_name; // The shortcut for this TemplateURL. May be empty. - void SetKeyword(const string16& keyword) const; + void SetKeyword(const string16& keyword); const string16& keyword(const TemplateURL* t_url) const; // TODO(pkasting): This should only be necessary until we eliminate keyword // autogeneration. @@ -261,7 +261,7 @@ struct TemplateURLData { // consumers should not need this. // NOTE: Calling SetKeyword() turns this back off. Manual and automatic // keywords are mutually exclusive. - void SetAutogenerateKeyword(bool autogenerate_keyword) const; + void SetAutogenerateKeyword(bool autogenerate_keyword); bool autogenerate_keyword() const { return autogenerate_keyword_; } // Ensures that the keyword is generated. Most consumers should not need this @@ -342,7 +342,7 @@ struct TemplateURLData { std::string url_; // TODO(pkasting): These fields will go away soon. - mutable bool autogenerate_keyword_; + bool autogenerate_keyword_; // True if the keyword was generated. This is used to avoid multiple attempts // if generating a keyword failed. mutable bool keyword_generated_; @@ -395,7 +395,6 @@ class TemplateURL { const GURL& originating_url() const { return data_.originating_url; } bool show_in_default_list() const { return data_.show_in_default_list; } - // Returns true if show_in_default_list() is true and this TemplateURL has a // TemplateURLRef that supports replacement. bool ShowInDefaultList() const; @@ -442,7 +441,7 @@ class TemplateURL { void SetPrepopulateId(int id); // Invalidates cached values on this object and its child TemplateURLRefs. - void InvalidateCachedValues() const; + void InvalidateCachedValues(); TemplateURLData data_; TemplateURLRef url_ref_; |