Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9588)

Unified Diff: chrome/browser/views/first_run_search_engine_view.cc

Issue 3171028: Change search engine dialog image to be transparent, and use this image flipp... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/first_run_search_engine_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/first_run_search_engine_view.cc
===================================================================
--- chrome/browser/views/first_run_search_engine_view.cc (revision 57198)
+++ chrome/browser/views/first_run_search_engine_view.cc (working copy)
@@ -15,6 +15,7 @@
#include "chrome/browser/profile.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_prepopulate_data.h"
+#include "gfx/canvas.h"
#include "gfx/font.h"
#include "grit/browser_resources.h"
#include "grit/chromium_strings.h"
@@ -142,6 +143,16 @@
MessageLoop::current()->Quit();
}
+void FirstRunSearchEngineView::Paint(gfx::Canvas* canvas) {
+ // Fill in behind the background image with the standard gray toolbar color.
+ canvas->FillRectInt(SkColorSetRGB(237, 238, 237), 0, 0, width(),
+ background_image_->height());
+ // The rest of the dialog background should be white.
+ DCHECK(height() > background_image_->height());
+ canvas->FillRectInt(SK_ColorWHITE, 0, background_image_->height(), width(),
+ height() - background_image_->height());
+}
+
void FirstRunSearchEngineView::OnTemplateURLModelChanged() {
using views::ImageView;
@@ -244,20 +255,18 @@
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
background_image_ = new views::ImageView();
+ background_image_->SetImage(rb.GetBitmapNamed(IDR_SEARCH_ENGINE_DIALOG_TOP));
+ background_image_->EnableCanvasFlippingForRTLUI(true);
if (text_direction_is_rtl_) {
- background_image_->SetImage(rb.GetBitmapNamed(
- IDR_SEARCH_ENGINE_DIALOG_TOP_RTL));
+ background_image_->SetHorizontalAlignment(ImageView::LEADING);
} else {
- background_image_->SetImage(rb.GetBitmapNamed(
- IDR_SEARCH_ENGINE_DIALOG_TOP));
+ background_image_->SetHorizontalAlignment(ImageView::TRAILING);
}
- background_image_->SetHorizontalAlignment(ImageView::TRAILING);
+
AddChildView(background_image_);
int label_width = GetPreferredSize().width() - 2 * kPanelHorizMargin;
- set_background(Background::CreateSolidBackground(SK_ColorWHITE));
-
// Add title and text asking the user to choose a search engine:
title_label_ = new Label(l10n_util::GetString(
IDS_FR_SEARCH_MAIN_LABEL));
« no previous file with comments | « chrome/browser/views/first_run_search_engine_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698