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 #include "chrome/browser/ui/views/default_search_view.h" | 5 #include "chrome/browser/ui/views/default_search_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 } else { | 128 } else { |
129 delete proposed_default_turl; | 129 delete proposed_default_turl; |
130 } | 130 } |
131 } | 131 } |
132 | 132 |
133 DefaultSearchView::~DefaultSearchView() { | 133 DefaultSearchView::~DefaultSearchView() { |
134 } | 134 } |
135 | 135 |
136 void DefaultSearchView::OnPaint(gfx::Canvas* canvas) { | 136 void DefaultSearchView::OnPaint(gfx::Canvas* canvas) { |
137 // Fill in behind the background image with the standard gray toolbar color. | 137 // Fill in behind the background image with the standard gray toolbar color. |
138 canvas->FillRect(GetThemeProvider()->GetColor(ThemeService::COLOR_TOOLBAR), | 138 canvas->FillRect(gfx::Rect(0, 0, width(), background_image_->height()), |
139 gfx::Rect(0, 0, width(), background_image_->height())); | 139 GetThemeProvider()->GetColor(ThemeService::COLOR_TOOLBAR)); |
140 // The rest of the dialog background should be white. | 140 // The rest of the dialog background should be white. |
141 DCHECK(height() > background_image_->height()); | 141 DCHECK(height() > background_image_->height()); |
142 canvas->FillRect(SK_ColorWHITE, | 142 canvas->FillRect(gfx::Rect(0, background_image_->height(), width(), |
143 gfx::Rect(0, background_image_->height(), width(), | 143 height() - background_image_->height()), |
144 height() - background_image_->height())); | 144 SK_ColorWHITE); |
145 } | 145 } |
146 | 146 |
147 void DefaultSearchView::ButtonPressed(views::Button* sender, | 147 void DefaultSearchView::ButtonPressed(views::Button* sender, |
148 const views::Event& event) { | 148 const views::Event& event) { |
149 views::DialogClientView* client = GetDialogClientView(); | 149 views::DialogClientView* client = GetDialogClientView(); |
150 if (sender == proposed_provider_button_) | 150 if (sender == proposed_provider_button_) |
151 client->AcceptWindow(); | 151 client->AcceptWindow(); |
152 else | 152 else |
153 client->CancelWindow(); | 153 client->CancelWindow(); |
154 } | 154 } |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 this, | 306 this, |
307 IDS_DEFAULT_SEARCH_PROMPT_CURRENT, | 307 IDS_DEFAULT_SEARCH_PROMPT_CURRENT, |
308 default_short_name); | 308 default_short_name); |
309 layout->AddView(default_provider_button_); | 309 layout->AddView(default_provider_button_); |
310 proposed_provider_button_ = CreateProviderChoiceButton( | 310 proposed_provider_button_ = CreateProviderChoiceButton( |
311 this, | 311 this, |
312 IDS_DEFAULT_SEARCH_PROMPT_PROPOSED, | 312 IDS_DEFAULT_SEARCH_PROMPT_PROPOSED, |
313 proposed_short_name); | 313 proposed_short_name); |
314 layout->AddView(proposed_provider_button_); | 314 layout->AddView(proposed_provider_button_); |
315 } | 315 } |
OLD | NEW |