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

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

Issue 9447096: gtk: Rename GtkThemeService to ThemeServiceGtk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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
« no previous file with comments | « chrome/browser/ui/gtk/first_run_bubble.cc ('k') | chrome/browser/ui/gtk/global_history_menu.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/global_error_bubble.h" 5 #include "chrome/browser/ui/gtk/global_error_bubble.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "chrome/browser/ui/browser.h" 11 #include "chrome/browser/ui/browser.h"
12 #include "chrome/browser/ui/global_error.h" 12 #include "chrome/browser/ui/global_error.h"
13 #include "chrome/browser/ui/global_error_service.h" 13 #include "chrome/browser/ui/global_error_service.h"
14 #include "chrome/browser/ui/global_error_service_factory.h" 14 #include "chrome/browser/ui/global_error_service_factory.h"
15 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h" 15 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h"
16 #include "chrome/browser/ui/gtk/browser_window_gtk.h" 16 #include "chrome/browser/ui/gtk/browser_window_gtk.h"
17 #include "chrome/browser/ui/gtk/gtk_theme_service.h"
18 #include "chrome/browser/ui/gtk/gtk_util.h" 17 #include "chrome/browser/ui/gtk/gtk_util.h"
18 #include "chrome/browser/ui/gtk/theme_service_gtk.h"
19 #include "ui/base/gtk/gtk_hig_constants.h" 19 #include "ui/base/gtk/gtk_hig_constants.h"
20 #include "ui/base/resource/resource_bundle.h" 20 #include "ui/base/resource/resource_bundle.h"
21 #include "ui/gfx/gtk_util.h" 21 #include "ui/gfx/gtk_util.h"
22 #include "ui/gfx/image/image.h" 22 #include "ui/gfx/image/image.h"
23 23
24 namespace { 24 namespace {
25 25
26 // Padding between content and edge of bubble. 26 // Padding between content and edge of bubble.
27 const int kContentBorder = 7; 27 const int kContentBorder = 7;
28 28
(...skipping 16 matching lines...) Expand all
45 GtkWidget* anchor) 45 GtkWidget* anchor)
46 : browser_(browser), 46 : browser_(browser),
47 bubble_(NULL), 47 bubble_(NULL),
48 error_(error) { 48 error_(error) {
49 DCHECK(browser_); 49 DCHECK(browser_);
50 DCHECK(error_); 50 DCHECK(error_);
51 GtkWidget* content = gtk_vbox_new(FALSE, kInterLineSpacing); 51 GtkWidget* content = gtk_vbox_new(FALSE, kInterLineSpacing);
52 gtk_container_set_border_width(GTK_CONTAINER(content), kContentBorder); 52 gtk_container_set_border_width(GTK_CONTAINER(content), kContentBorder);
53 g_signal_connect(content, "destroy", G_CALLBACK(OnDestroyThunk), this); 53 g_signal_connect(content, "destroy", G_CALLBACK(OnDestroyThunk), this);
54 54
55 GtkThemeService* theme_service = 55 ThemeServiceGtk* theme_service =
56 GtkThemeService::GetFrom(browser_->profile()); 56 ThemeServiceGtk::GetFrom(browser_->profile());
57 57
58 int resource_id = error_->GetBubbleViewIconResourceID(); 58 int resource_id = error_->GetBubbleViewIconResourceID();
59 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 59 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
60 GdkPixbuf* pixbuf = rb.GetNativeImageNamed(resource_id).ToGdkPixbuf(); 60 GdkPixbuf* pixbuf = rb.GetNativeImageNamed(resource_id).ToGdkPixbuf();
61 GtkWidget* image_view = gtk_image_new_from_pixbuf(pixbuf); 61 GtkWidget* image_view = gtk_image_new_from_pixbuf(pixbuf);
62 62
63 GtkWidget* title_label = theme_service->BuildLabel( 63 GtkWidget* title_label = theme_service->BuildLabel(
64 UTF16ToUTF8(error_->GetBubbleViewTitle()), 64 UTF16ToUTF8(error_->GetBubbleViewTitle()),
65 ui::kGdkBlack); 65 ui::kGdkBlack);
66 GtkWidget* message_label = theme_service->BuildLabel( 66 GtkWidget* message_label = theme_service->BuildLabel(
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 Browser* browser, 153 Browser* browser,
154 const base::WeakPtr<GlobalError>& error) { 154 const base::WeakPtr<GlobalError>& error) {
155 BrowserWindowGtk* browser_window = 155 BrowserWindowGtk* browser_window =
156 BrowserWindowGtk::GetBrowserWindowForNativeWindow( 156 BrowserWindowGtk::GetBrowserWindowForNativeWindow(
157 browser->window()->GetNativeHandle()); 157 browser->window()->GetNativeHandle());
158 GtkWidget* anchor = browser_window->GetToolbar()->GetAppMenuButton(); 158 GtkWidget* anchor = browser_window->GetToolbar()->GetAppMenuButton();
159 159
160 // The bubble will be automatically deleted when it's closed. 160 // The bubble will be automatically deleted when it's closed.
161 return new GlobalErrorBubble(browser, error, anchor); 161 return new GlobalErrorBubble(browser, error, anchor);
162 } 162 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/first_run_bubble.cc ('k') | chrome/browser/ui/gtk/global_history_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698