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

Side by Side Diff: chrome/browser/ui/gtk/edit_search_engine_dialog.cc

Issue 9815006: ui/gfx: Remove the deprecated "operator const GdkPixbuf*" from Image API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/gtk/edit_search_engine_dialog.h" 5 #include "chrome/browser/ui/gtk/edit_search_engine_dialog.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "base/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 IDS_SEARCH_ENGINES_INVALID_KEYWORD_TT); 239 IDS_SEARCH_ENGINES_INVALID_KEYWORD_TT);
240 UpdateImage(url_image_, controller_->IsURLValid(GetURLInput()), 240 UpdateImage(url_image_, controller_->IsURLValid(GetURLInput()),
241 IDS_SEARCH_ENGINES_INVALID_URL_TT); 241 IDS_SEARCH_ENGINES_INVALID_URL_TT);
242 UpdateImage(title_image_, controller_->IsTitleValid(GetTitleInput()), 242 UpdateImage(title_image_, controller_->IsTitleValid(GetTitleInput()),
243 IDS_SEARCH_ENGINES_INVALID_TITLE_TT); 243 IDS_SEARCH_ENGINES_INVALID_TITLE_TT);
244 } 244 }
245 245
246 void EditSearchEngineDialog::UpdateImage(GtkWidget* image, 246 void EditSearchEngineDialog::UpdateImage(GtkWidget* image,
247 bool is_valid, 247 bool is_valid,
248 int invalid_message_id) { 248 int invalid_message_id) {
249 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
249 if (is_valid) { 250 if (is_valid) {
250 gtk_widget_set_has_tooltip(image, FALSE); 251 gtk_widget_set_has_tooltip(image, FALSE);
251 gtk_image_set_from_pixbuf(GTK_IMAGE(image), 252 gtk_image_set_from_pixbuf(GTK_IMAGE(image),
252 ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( 253 rb.GetNativeImageNamed(IDR_INPUT_GOOD).ToGdkPixbuf());
253 IDR_INPUT_GOOD));
254 } else { 254 } else {
255 gtk_widget_set_tooltip_text( 255 gtk_widget_set_tooltip_text(
256 image, l10n_util::GetStringUTF8(invalid_message_id).c_str()); 256 image, l10n_util::GetStringUTF8(invalid_message_id).c_str());
257 gtk_image_set_from_pixbuf(GTK_IMAGE(image), 257 gtk_image_set_from_pixbuf(GTK_IMAGE(image),
258 ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( 258 rb.GetNativeImageNamed(IDR_INPUT_ALERT).ToGdkPixbuf());
259 IDR_INPUT_ALERT));
260 } 259 }
261 } 260 }
262 261
263 void EditSearchEngineDialog::OnEntryChanged(GtkEditable* editable) { 262 void EditSearchEngineDialog::OnEntryChanged(GtkEditable* editable) {
264 EnableControls(); 263 EnableControls();
265 } 264 }
266 265
267 void EditSearchEngineDialog::OnResponse(GtkWidget* dialog, int response_id) { 266 void EditSearchEngineDialog::OnResponse(GtkWidget* dialog, int response_id) {
268 if (response_id == GTK_RESPONSE_OK) { 267 if (response_id == GTK_RESPONSE_OK) {
269 controller_->AcceptAddOrEdit(GetTitleInput(), 268 controller_->AcceptAddOrEdit(GetTitleInput(),
270 GetKeywordInput(), 269 GetKeywordInput(),
271 GetURLInput()); 270 GetURLInput());
272 } else { 271 } else {
273 controller_->CleanUpCancelledAdd(); 272 controller_->CleanUpCancelledAdd();
274 } 273 }
275 gtk_widget_destroy(dialog_); 274 gtk_widget_destroy(dialog_);
276 } 275 }
277 276
278 void EditSearchEngineDialog::OnWindowDestroy(GtkWidget* widget) { 277 void EditSearchEngineDialog::OnWindowDestroy(GtkWidget* widget) {
279 MessageLoop::current()->DeleteSoon(FROM_HERE, this); 278 MessageLoop::current()->DeleteSoon(FROM_HERE, this);
280 } 279 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/download/download_started_animation_gtk.cc ('k') | chrome/browser/ui/gtk/gtk_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698