Fix omnibox appearance with the new asset:

1. Change border asset to point to the new one.
2. Change omnibox background color to an OS dependent color instead of white.
3. Delete the obsolete omnibox_border.png entr in the grd file.

BUG=137351
TEST=none


Review URL: https://chromiumcodereview.appspot.com/10829383

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152436 0039d316-1c4b-4281-b951-d872f2087c98
parent 85e84386
...@@ -355,11 +355,10 @@ ...@@ -355,11 +355,10 @@
<structure type="chrome_scaled_image" name="IDR_LOCATIONBG_POPUPMODE_EDGE" file="omnibox_popup_edge.png" /> <structure type="chrome_scaled_image" name="IDR_LOCATIONBG_POPUPMODE_EDGE" file="omnibox_popup_edge.png" />
<if expr="not pp_ifdef('toolkit_views')"> <if expr="not pp_ifdef('toolkit_views')">
<structure type="chrome_scaled_image" name="IDR_LOCATIONBG_R" file="omnibox_r.png" /> <structure type="chrome_scaled_image" name="IDR_LOCATIONBG_R" file="omnibox_r.png" />
<structure type="chrome_scaled_image" name="IDR_LOCATION_BAR_BORDER" file="omnibox_border.png" />
</if> </if>
<if expr="pp_ifdef('toolkit_views')"> <if expr="pp_ifdef('toolkit_views')">
<structure type="chrome_scaled_image" name="IDR_LOCATIONBG_R" file="common/browser_omnibox_right.png" /> <structure type="chrome_scaled_image" name="IDR_LOCATIONBG_R" file="common/browser_omnibox_right.png" />
<structure type="chrome_scaled_image" name="IDR_LOCATION_BAR_BORDER" file="ash/browser_omnibox_border.png" /> <structure type="chrome_scaled_image" name="IDR_LOCATION_BAR_BORDER" file="common/browser_omnibox_border.png" />
</if> </if>
<if expr="is_macosx"> <if expr="is_macosx">
<structure type="chrome_scaled_image" name="IDR_LOCATION_BAR_KEYWORD_HINT_TAB" file="keyword_hint_tab_mac.png" /> <structure type="chrome_scaled_image" name="IDR_LOCATION_BAR_KEYWORD_HINT_TAB" file="keyword_hint_tab_mac.png" />
......
...@@ -29,7 +29,7 @@ void LocationBarContainer::PlatformInit() { ...@@ -29,7 +29,7 @@ void LocationBarContainer::PlatformInit() {
// static // static
SkColor LocationBarContainer::GetBackgroundColor() { SkColor LocationBarContainer::GetBackgroundColor() {
return SK_ColorWHITE; return LocationBarView::kOmniboxBackgroundColor;
} }
void LocationBarContainer::StackAtTop() { void LocationBarContainer::StackAtTop() {
......
...@@ -128,6 +128,13 @@ const int LocationBarView::kNormalHorizontalEdgeThickness = 2; ...@@ -128,6 +128,13 @@ const int LocationBarView::kNormalHorizontalEdgeThickness = 2;
const int LocationBarView::kVerticalEdgeThickness = 3; const int LocationBarView::kVerticalEdgeThickness = 3;
const int LocationBarView::kIconInternalPadding = 2; const int LocationBarView::kIconInternalPadding = 2;
const int LocationBarView::kBubbleHorizontalPadding = 1; const int LocationBarView::kBubbleHorizontalPadding = 1;
#if defined(OS_CHROMEOS)
const SkColor LocationBarView::kOmniboxBackgroundColor =
SkColorSetARGB(0, 255, 255, 255);
#else
const SkColor LocationBarView::kOmniboxBackgroundColor =
SkColorSetARGB(255, 255, 255, 255);
#endif
const char LocationBarView::kViewClassName[] = const char LocationBarView::kViewClassName[] =
"browser/ui/views/location_bar/LocationBarView"; "browser/ui/views/location_bar/LocationBarView";
...@@ -325,7 +332,7 @@ SkColor LocationBarView::GetColor(ToolbarModel::SecurityLevel security_level, ...@@ -325,7 +332,7 @@ SkColor LocationBarView::GetColor(ToolbarModel::SecurityLevel security_level,
case SELECTED_TEXT: return color_utils::GetSysSkColor(COLOR_HIGHLIGHTTEXT); case SELECTED_TEXT: return color_utils::GetSysSkColor(COLOR_HIGHLIGHTTEXT);
#else #else
// TODO(beng): source from theme provider. // TODO(beng): source from theme provider.
case BACKGROUND: return SK_ColorWHITE; case BACKGROUND: return LocationBarView::kOmniboxBackgroundColor;
case TEXT: return SK_ColorBLACK; case TEXT: return SK_ColorBLACK;
case SELECTED_TEXT: return SK_ColorWHITE; case SELECTED_TEXT: return SK_ColorWHITE;
#endif #endif
......
...@@ -363,6 +363,8 @@ class LocationBarView : public LocationBar, ...@@ -363,6 +363,8 @@ class LocationBarView : public LocationBar,
static const int kIconInternalPadding; static const int kIconInternalPadding;
// Space between the edge and a bubble. // Space between the edge and a bubble.
static const int kBubbleHorizontalPadding; static const int kBubbleHorizontalPadding;
// Background color of the location bar.
static const SkColor kOmniboxBackgroundColor;
protected: protected:
virtual void OnFocus() OVERRIDE; virtual void OnFocus() OVERRIDE;
......
...@@ -237,7 +237,7 @@ OmniboxViewViews::OmniboxViewViews(OmniboxEditController* controller, ...@@ -237,7 +237,7 @@ OmniboxViewViews::OmniboxViewViews(OmniboxEditController* controller,
if (chrome::search::IsInstantExtendedAPIEnabled( if (chrome::search::IsInstantExtendedAPIEnabled(
location_bar_view_->profile())) { location_bar_view_->profile())) {
set_background(views::Background::CreateSolidBackground( set_background(views::Background::CreateSolidBackground(
chrome::search::kOmniboxBackgroundColor)); LocationBarView::kOmniboxBackgroundColor));
} }
} }
...@@ -262,6 +262,7 @@ void OmniboxViewViews::Init(views::View* popup_parent_view) { ...@@ -262,6 +262,7 @@ void OmniboxViewViews::Init(views::View* popup_parent_view) {
textfield_ = new AutocompleteTextfield(this, location_bar_view_); textfield_ = new AutocompleteTextfield(this, location_bar_view_);
textfield_->SetController(this); textfield_->SetController(this);
textfield_->SetTextInputType(ui::TEXT_INPUT_TYPE_URL); textfield_->SetTextInputType(ui::TEXT_INPUT_TYPE_URL);
textfield_->SetBackgroundColor(LocationBarView::kOmniboxBackgroundColor);
if (popup_window_mode_) if (popup_window_mode_)
textfield_->SetReadOnly(true); textfield_->SetReadOnly(true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment