diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-21 17:13:17 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-21 17:13:17 +0000 |
commit | e4265c11ae23e771cd406976a3875b5ccd72a706 (patch) | |
tree | 0e0aabdfbc453b24e7120edc9afb4713f4428942 | |
parent | d13e6c922573b8188a34db91dd21bb1c8e7456e8 (diff) | |
download | chromium_src-e4265c11ae23e771cd406976a3875b5ccd72a706.zip chromium_src-e4265c11ae23e771cd406976a3875b5ccd72a706.tar.gz chromium_src-e4265c11ae23e771cd406976a3875b5ccd72a706.tar.bz2 |
Merge 157549 - Update page icon in the omnibox
The location bar and the omnibox popup currently show an
"empty page" icon for http entries. This CL makes it so that
the asset in the location bar is different from the one in
the popup, and updates the asset used in both places.
BUG=149903
Review URL: https://codereview.chromium.org/10951023
TBR=thakis@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/branches/1271/src@158014 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/theme/default_100_percent/common/location_bar_http.png | bin | 0 -> 1253 bytes | |||
-rw-r--r-- | chrome/app/theme/default_100_percent/common/omnibox_http.png | bin | 137 -> 1072 bytes | |||
-rw-r--r-- | chrome/app/theme/default_100_percent/common/omnibox_http_selected.png | bin | 119 -> 1050 bytes | |||
-rw-r--r-- | chrome/app/theme/default_200_percent/common/location_bar_http.png | bin | 0 -> 1338 bytes | |||
-rw-r--r-- | chrome/app/theme/default_200_percent/common/omnibox_http.png | bin | 282 -> 1203 bytes | |||
-rw-r--r-- | chrome/app/theme/default_200_percent/common/omnibox_http_selected.png | bin | 177 -> 1100 bytes | |||
-rw-r--r-- | chrome/app/theme/theme_resources.grd | 1 | ||||
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_match.cc | 8 | ||||
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_match.h | 6 | ||||
-rw-r--r-- | chrome/browser/ui/omnibox/omnibox_view.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/toolbar/toolbar_model.cc | 2 |
11 files changed, 16 insertions, 3 deletions
diff --git a/chrome/app/theme/default_100_percent/common/location_bar_http.png b/chrome/app/theme/default_100_percent/common/location_bar_http.png Binary files differnew file mode 100644 index 0000000..9d23c5e --- /dev/null +++ b/chrome/app/theme/default_100_percent/common/location_bar_http.png diff --git a/chrome/app/theme/default_100_percent/common/omnibox_http.png b/chrome/app/theme/default_100_percent/common/omnibox_http.png Binary files differindex d29b501..4603e23 100644 --- a/chrome/app/theme/default_100_percent/common/omnibox_http.png +++ b/chrome/app/theme/default_100_percent/common/omnibox_http.png diff --git a/chrome/app/theme/default_100_percent/common/omnibox_http_selected.png b/chrome/app/theme/default_100_percent/common/omnibox_http_selected.png Binary files differindex 3ea6814..669f3ce 100644 --- a/chrome/app/theme/default_100_percent/common/omnibox_http_selected.png +++ b/chrome/app/theme/default_100_percent/common/omnibox_http_selected.png diff --git a/chrome/app/theme/default_200_percent/common/location_bar_http.png b/chrome/app/theme/default_200_percent/common/location_bar_http.png Binary files differnew file mode 100644 index 0000000..d0b9ff0 --- /dev/null +++ b/chrome/app/theme/default_200_percent/common/location_bar_http.png diff --git a/chrome/app/theme/default_200_percent/common/omnibox_http.png b/chrome/app/theme/default_200_percent/common/omnibox_http.png Binary files differindex 08343ff..8ca6c1c 100644 --- a/chrome/app/theme/default_200_percent/common/omnibox_http.png +++ b/chrome/app/theme/default_200_percent/common/omnibox_http.png diff --git a/chrome/app/theme/default_200_percent/common/omnibox_http_selected.png b/chrome/app/theme/default_200_percent/common/omnibox_http_selected.png Binary files differindex 9b00f19..f3cab26 100644 --- a/chrome/app/theme/default_200_percent/common/omnibox_http_selected.png +++ b/chrome/app/theme/default_200_percent/common/omnibox_http_selected.png diff --git a/chrome/app/theme/theme_resources.grd b/chrome/app/theme/theme_resources.grd index 6c69c6c..ac0e75a 100644 --- a/chrome/app/theme/theme_resources.grd +++ b/chrome/app/theme/theme_resources.grd @@ -417,6 +417,7 @@ <structure type="chrome_scaled_image" name="IDR_INPUT_GOOD" file="input_good.png" /> <structure type="chrome_scaled_image" name="IDR_KEYWORD_SEARCH_MAGNIFIER" file="keyword_search_magnifier.png" /> <structure type="chrome_scaled_image" name="IDR_KILLED_TAB" file="killtab.png" /> + <structure type="chrome_scaled_image" name="IDR_LOCATION_BAR_HTTP" file="common/location_bar_http.png" /> <if expr="not pp_ifdef('toolkit_views')"> <structure type="chrome_scaled_image" name="IDR_LOCATIONBG_C" file="omnibox_c.png" /> <structure type="chrome_scaled_image" name="IDR_LOCATIONBG_L" file="omnibox_l.png" /> diff --git a/chrome/browser/autocomplete/autocomplete_match.cc b/chrome/browser/autocomplete/autocomplete_match.cc index 32cb820..3909a32 100644 --- a/chrome/browser/autocomplete/autocomplete_match.cc +++ b/chrome/browser/autocomplete/autocomplete_match.cc @@ -174,6 +174,14 @@ int AutocompleteMatch::TypeToIcon(Type type) { } // static +int AutocompleteMatch::TypeToLocationBarIcon(Type type) { + int id = TypeToIcon(type); + if (id == IDR_OMNIBOX_HTTP) + return IDR_LOCATION_BAR_HTTP; + return id; +} + +// static bool AutocompleteMatch::MoreRelevant(const AutocompleteMatch& elem1, const AutocompleteMatch& elem2) { // For equal-relevance matches, we sort alphabetically, so that providers diff --git a/chrome/browser/autocomplete/autocomplete_match.h b/chrome/browser/autocomplete/autocomplete_match.h index 60bfeb5..f459578 100644 --- a/chrome/browser/autocomplete/autocomplete_match.h +++ b/chrome/browser/autocomplete/autocomplete_match.h @@ -112,9 +112,13 @@ struct AutocompleteMatch { static std::string TypeToString(Type type); // Converts |type| to a resource identifier for the appropriate icon for this - // type. + // type to show in the completion popup. static int TypeToIcon(Type type); + // Converts |type| to a resource identifier for the appropriate icon for this + // type to show in the location bar. + static int TypeToLocationBarIcon(Type type); + // Comparison function for determining when one match is better than another. static bool MoreRelevant(const AutocompleteMatch& elem1, const AutocompleteMatch& elem2); diff --git a/chrome/browser/ui/omnibox/omnibox_view.cc b/chrome/browser/ui/omnibox/omnibox_view.cc index e8bd344..f91b981 100644 --- a/chrome/browser/ui/omnibox/omnibox_view.cc +++ b/chrome/browser/ui/omnibox/omnibox_view.cc @@ -89,7 +89,7 @@ bool OmniboxView::IsEditingOrEmpty() const { int OmniboxView::GetIcon() const { if (IsEditingOrEmpty()) { - return AutocompleteMatch::TypeToIcon(model_.get() ? + return AutocompleteMatch::TypeToLocationBarIcon(model_.get() ? model_->CurrentTextType() : AutocompleteMatch::URL_WHAT_YOU_TYPED); } else { return toolbar_model_->GetIcon(); diff --git a/chrome/browser/ui/toolbar/toolbar_model.cc b/chrome/browser/ui/toolbar/toolbar_model.cc index c7a1646..c37d461 100644 --- a/chrome/browser/ui/toolbar/toolbar_model.cc +++ b/chrome/browser/ui/toolbar/toolbar_model.cc @@ -153,7 +153,7 @@ ToolbarModel::SecurityLevel ToolbarModel::GetSecurityLevel() const { int ToolbarModel::GetIcon() const { static int icon_ids[NUM_SECURITY_LEVELS] = { - IDR_OMNIBOX_HTTP, + IDR_LOCATION_BAR_HTTP, IDR_OMNIBOX_HTTPS_VALID, IDR_OMNIBOX_HTTPS_VALID, IDR_OMNIBOX_HTTPS_WARNING, |