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

Unified Diff: chrome/browser/ui/gtk/web_intent_picker_gtk.cc

Issue 11040053: retry 160232 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync changes Created 8 years, 2 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
Index: chrome/browser/ui/gtk/web_intent_picker_gtk.cc
diff --git a/chrome/browser/ui/gtk/web_intent_picker_gtk.cc b/chrome/browser/ui/gtk/web_intent_picker_gtk.cc
index 47cec583192887985f12b2e0f972fbc83c1b28b6..c942f5bb573623cf6280aecf9500968250f59c30 100644
--- a/chrome/browser/ui/gtk/web_intent_picker_gtk.cc
+++ b/chrome/browser/ui/gtk/web_intent_picker_gtk.cc
@@ -263,6 +263,11 @@ void WebIntentPickerGtk::OnExtensionInstallFailure(const std::string& id) {
SetWidgetsEnabled(true);
}
+void WebIntentPickerGtk::OnInlineDispositionAutoResize(const gfx::Size& size) {
+ gtk_widget_set_size_request(tab_contents_container_->widget(),
+ size.width(), size.height());
+}
+
void WebIntentPickerGtk::OnModelChanged(WebIntentPickerModel* model) {
if (waiting_dialog_.get() && !model->IsWaitingForSuggestions()) {
waiting_dialog_.reset();
@@ -306,17 +311,20 @@ void WebIntentPickerGtk::OnInlineDisposition(const string16& title,
// Replace the picker contents with the inline disposition.
ClearContents();
+ gtk_widget_set_size_request(contents_, -1, -1);
+ window_->BackgroundColorChanged();
- GtkWidget* vbox = gtk_vbox_new(FALSE, ui::kContentAreaSpacing);
+ GtkWidget* vbox = gtk_vbox_new(FALSE, 0);
GtkThemeService* theme_service = GetThemeService(tab_contents_);
GtkWidget* service_hbox = gtk_hbox_new(FALSE, ui::kControlSpacing);
// TODO(gbillock): Eventually get the service icon button here.
// Intent action label.
- GtkWidget* action_label = theme_service->BuildLabel(
- UTF16ToUTF8(title), ui::kGdkBlack);
+ GtkWidget* action_label = gtk_label_new(UTF16ToUTF8(title).c_str());
gtk_util::ForceFontSizePixels(action_label, kMainContentPixelSize);
+ // Hardcode color; don't allow theming.
+ gtk_util::SetLabelColor(action_label, &ui::kGdkBlack);
GtkWidget* label_alignment = gtk_alignment_new(0, 0.5f, 0, 0);
gtk_container_add(GTK_CONTAINER(label_alignment), action_label);
@@ -346,10 +354,7 @@ void WebIntentPickerGtk::OnInlineDisposition(const string16& title,
AddCloseButton(service_hbox);
// The header box
- gtk_box_pack_start(GTK_BOX(vbox), service_hbox, TRUE, TRUE, 0);
-
- // The separator between the icon/title/close and the inline renderer.
- gtk_box_pack_start(GTK_BOX(vbox), gtk_hseparator_new(), FALSE, TRUE, 0);
+ gtk_container_add(GTK_CONTAINER(vbox), service_hbox);
// hbox for the web contents, so we can have spacing on the borders.
GtkWidget* alignment = gtk_alignment_new(0.0, 0.0, 1.0, 1.0);
@@ -358,7 +363,7 @@ void WebIntentPickerGtk::OnInlineDisposition(const string16& title,
ui::kContentAreaBorder, ui::kContentAreaBorder);
gtk_container_add(GTK_CONTAINER(alignment),
tab_contents_container_->widget());
- gtk_box_pack_end(GTK_BOX(vbox), alignment, TRUE, TRUE, 0);
+ gtk_container_add(GTK_CONTAINER(vbox), alignment);
gtk_container_add(GTK_CONTAINER(contents_), vbox);
gfx::Size size = GetMinInlineDispositionSize();
@@ -367,11 +372,6 @@ void WebIntentPickerGtk::OnInlineDisposition(const string16& title,
gtk_widget_show_all(contents_);
}
-void WebIntentPickerGtk::OnInlineDispositionAutoResize(const gfx::Size& size) {
- gtk_widget_set_size_request(tab_contents_container_->widget(),
- size.width(), size.height());
-}
-
void WebIntentPickerGtk::OnPendingAsyncCompleted() {
// Requests to both the WebIntentService and the Chrome Web Store have
// completed. If there are any services, installed or suggested, there's
@@ -428,6 +428,15 @@ void WebIntentPickerGtk::DeleteDelegate() {
delegate_->OnClosing();
}
+bool WebIntentPickerGtk::GetBackgroundColor(GdkColor* color) {
+ if (tab_contents_container_.get()) {
+ *color = ui::kGdkWhite;
+ return true;
+ }
+
+ return false;
+}
+
bool WebIntentPickerGtk::ShouldHaveBorderPadding() const {
return false;
}
@@ -634,6 +643,7 @@ void WebIntentPickerGtk::ResetContents() {
inline_disposition_delegate_.reset(NULL);
tab_contents_container_.reset(NULL);
inline_disposition_tab_contents_.reset(NULL);
+ window_->BackgroundColorChanged();
// Re-initialize picker widgets and data.
InitMainContents();
« no previous file with comments | « chrome/browser/ui/gtk/web_intent_picker_gtk.h ('k') | chrome/browser/ui/intents/web_intent_inline_disposition_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698