| OLD | NEW |
| 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/web_intent_picker_gtk.h" | 5 #include "chrome/browser/ui/gtk/web_intent_picker_gtk.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 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/favicon/favicon_service.h" | 11 #include "chrome/browser/favicon/favicon_service.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/tab_contents/tab_util.h" | 13 #include "chrome/browser/tab_contents/tab_util.h" |
| 14 #include "chrome/browser/ui/browser_window.h" | 14 #include "chrome/browser/ui/browser_window.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/custom_button.h" | 17 #include "chrome/browser/ui/gtk/custom_button.h" |
| 18 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" | 18 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" |
| 19 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 19 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 20 #include "chrome/browser/ui/gtk/gtk_util.h" | 20 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 21 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" | 21 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" |
| 22 #include "chrome/browser/ui/gtk/tab_contents_container_gtk.h" | 22 #include "chrome/browser/ui/gtk/tab_contents_container_gtk.h" |
| 23 #include "chrome/browser/ui/gtk/throbber_gtk.h" | 23 #include "chrome/browser/ui/gtk/throbber_gtk.h" |
| 24 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" | 24 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" |
| 25 #include "chrome/browser/ui/intents/web_intent_picker_delegate.h" | 25 #include "chrome/browser/ui/intents/web_intent_picker_delegate.h" |
| 26 #include "chrome/browser/ui/intents/web_intent_picker_model.h" | 26 #include "chrome/browser/ui/intents/web_intent_picker_model.h" |
| 27 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 27 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 28 #include "chrome/common/chrome_notification_types.h" | 28 #include "chrome/common/chrome_notification_types.h" |
| 29 #include "content/public/browser/notification_source.h" | 29 #include "content/public/browser/notification_source.h" |
| 30 #include "content/public/browser/notification_types.h" | 30 #include "content/public/browser/notification_types.h" |
| 31 #include "content/public/browser/render_view_host.h" | 31 #include "content/public/browser/render_view_host.h" |
| 32 #include "content/public/browser/render_widget_host_view.h" | 32 #include "content/public/browser/render_widget_host_view.h" |
| 33 #include "content/public/browser/web_contents.h" | 33 #include "content/public/browser/web_contents.h" |
| 34 #include "googleurl/src/gurl.h" | 34 #include "googleurl/src/gurl.h" |
| 35 #include "grit/chromium_strings.h" | 35 #include "grit/chromium_strings.h" |
| 36 #include "grit/generated_resources.h" | 36 #include "grit/generated_resources.h" |
| 37 #include "grit/google_chrome_strings.h" | 37 #include "grit/google_chrome_strings.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 61 const int kTitleLinkMaxWidth = 130; | 61 const int kTitleLinkMaxWidth = 130; |
| 62 | 62 |
| 63 // Indices of the extension row widgets. | 63 // Indices of the extension row widgets. |
| 64 enum { | 64 enum { |
| 65 kIconIndex, | 65 kIconIndex, |
| 66 kTitleLinkIndex, | 66 kTitleLinkIndex, |
| 67 kStarsIndex, | 67 kStarsIndex, |
| 68 kInstallButtonIndex, | 68 kInstallButtonIndex, |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 GtkThemeService *GetThemeService(TabContentsWrapper* wrapper) { | 71 GtkThemeService *GetThemeService(TabContents* tab_contents) { |
| 72 return GtkThemeService::GetFrom(wrapper->profile()); | 72 return GtkThemeService::GetFrom(tab_contents->profile()); |
| 73 } | 73 } |
| 74 | 74 |
| 75 // Set the image of |button| to |pixbuf|. | 75 // Set the image of |button| to |pixbuf|. |
| 76 void SetServiceButtonImage(GtkWidget* button, GdkPixbuf* pixbuf) { | 76 void SetServiceButtonImage(GtkWidget* button, GdkPixbuf* pixbuf) { |
| 77 gtk_button_set_image(GTK_BUTTON(button), gtk_image_new_from_pixbuf(pixbuf)); | 77 gtk_button_set_image(GTK_BUTTON(button), gtk_image_new_from_pixbuf(pixbuf)); |
| 78 gtk_button_set_image_position(GTK_BUTTON(button), GTK_POS_LEFT); | 78 gtk_button_set_image_position(GTK_BUTTON(button), GTK_POS_LEFT); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void SetWidgetFontSizeCallback(GtkWidget* widget, gpointer data) { | 81 void SetWidgetFontSizeCallback(GtkWidget* widget, gpointer data) { |
| 82 if (GTK_IS_LABEL(widget)) { | 82 if (GTK_IS_LABEL(widget)) { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 gtk_box_pack_start(GTK_BOX(hbox), gtk_image_new_from_pixbuf(star), | 130 gtk_box_pack_start(GTK_BOX(hbox), gtk_image_new_from_pixbuf(star), |
| 131 FALSE, FALSE, 0); | 131 FALSE, FALSE, 0); |
| 132 } | 132 } |
| 133 | 133 |
| 134 return hbox; | 134 return hbox; |
| 135 } | 135 } |
| 136 | 136 |
| 137 } // namespace | 137 } // namespace |
| 138 | 138 |
| 139 // static | 139 // static |
| 140 WebIntentPicker* WebIntentPicker::Create(TabContentsWrapper* wrapper, | 140 WebIntentPicker* WebIntentPicker::Create(TabContents* tab_contents, |
| 141 WebIntentPickerDelegate* delegate, | 141 WebIntentPickerDelegate* delegate, |
| 142 WebIntentPickerModel* model) { | 142 WebIntentPickerModel* model) { |
| 143 return new WebIntentPickerGtk(wrapper, delegate, model); | 143 return new WebIntentPickerGtk(tab_contents, delegate, model); |
| 144 } | 144 } |
| 145 | 145 |
| 146 WebIntentPickerGtk::WebIntentPickerGtk(TabContentsWrapper* wrapper, | 146 WebIntentPickerGtk::WebIntentPickerGtk(TabContents* tab_contents, |
| 147 WebIntentPickerDelegate* delegate, | 147 WebIntentPickerDelegate* delegate, |
| 148 WebIntentPickerModel* model) | 148 WebIntentPickerModel* model) |
| 149 : wrapper_(wrapper), | 149 : tab_contents_(tab_contents), |
| 150 delegate_(delegate), | 150 delegate_(delegate), |
| 151 model_(model), | 151 model_(model), |
| 152 contents_(NULL), | 152 contents_(NULL), |
| 153 header_label_(NULL), | 153 header_label_(NULL), |
| 154 button_vbox_(NULL), | 154 button_vbox_(NULL), |
| 155 cws_label_(NULL), | 155 cws_label_(NULL), |
| 156 extensions_vbox_(NULL), | 156 extensions_vbox_(NULL), |
| 157 window_(NULL) { | 157 window_(NULL) { |
| 158 DCHECK(delegate_ != NULL); | 158 DCHECK(delegate_ != NULL); |
| 159 | 159 |
| 160 model_->set_observer(this); | 160 model_->set_observer(this); |
| 161 InitContents(); | 161 InitContents(); |
| 162 UpdateInstalledServices(); | 162 UpdateInstalledServices(); |
| 163 UpdateCWSLabel(); | 163 UpdateCWSLabel(); |
| 164 UpdateSuggestedExtensions(); | 164 UpdateSuggestedExtensions(); |
| 165 | 165 |
| 166 GtkThemeService* theme_service = GetThemeService(wrapper); | 166 GtkThemeService* theme_service = GetThemeService(tab_contents); |
| 167 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 167 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
| 168 content::Source<ThemeService>(theme_service)); | 168 content::Source<ThemeService>(theme_service)); |
| 169 theme_service->InitThemesFor(this); | 169 theme_service->InitThemesFor(this); |
| 170 | 170 |
| 171 window_ = new ConstrainedWindowGtk(wrapper, this); | 171 window_ = new ConstrainedWindowGtk(tab_contents, this); |
| 172 } | 172 } |
| 173 | 173 |
| 174 WebIntentPickerGtk::~WebIntentPickerGtk() { | 174 WebIntentPickerGtk::~WebIntentPickerGtk() { |
| 175 } | 175 } |
| 176 | 176 |
| 177 void WebIntentPickerGtk::Close() { | 177 void WebIntentPickerGtk::Close() { |
| 178 window_->CloseConstrainedWindow(); | 178 window_->CloseConstrainedWindow(); |
| 179 if (inline_disposition_tab_contents_.get()) | 179 if (inline_disposition_tab_contents_.get()) |
| 180 inline_disposition_tab_contents_->web_contents()->OnCloseStarted(); | 180 inline_disposition_tab_contents_->web_contents()->OnCloseStarted(); |
| 181 } | 181 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 } | 215 } |
| 216 | 216 |
| 217 void WebIntentPickerGtk::OnExtensionIconChanged(WebIntentPickerModel* model, | 217 void WebIntentPickerGtk::OnExtensionIconChanged(WebIntentPickerModel* model, |
| 218 const string16& extension_id) { | 218 const string16& extension_id) { |
| 219 UpdateSuggestedExtensions(); | 219 UpdateSuggestedExtensions(); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void WebIntentPickerGtk::OnInlineDisposition(WebIntentPickerModel* model, | 222 void WebIntentPickerGtk::OnInlineDisposition(WebIntentPickerModel* model, |
| 223 const GURL& url) { | 223 const GURL& url) { |
| 224 content::WebContents* web_contents = content::WebContents::Create( | 224 content::WebContents* web_contents = content::WebContents::Create( |
| 225 wrapper_->profile(), | 225 tab_contents_->profile(), |
| 226 tab_util::GetSiteInstanceForNewTab(wrapper_->profile(), url), | 226 tab_util::GetSiteInstanceForNewTab(tab_contents_->profile(), url), |
| 227 MSG_ROUTING_NONE, NULL, NULL); | 227 MSG_ROUTING_NONE, NULL, NULL); |
| 228 inline_disposition_tab_contents_.reset(new TabContentsWrapper(web_contents)); | 228 inline_disposition_tab_contents_.reset(new TabContents(web_contents)); |
| 229 inline_disposition_delegate_.reset( | 229 inline_disposition_delegate_.reset( |
| 230 new WebIntentInlineDispositionDelegate(this, web_contents, | 230 new WebIntentInlineDispositionDelegate(this, web_contents, |
| 231 wrapper_->profile())); | 231 tab_contents_->profile())); |
| 232 | 232 |
| 233 // Must call this immediately after WebContents creation to avoid race | 233 // Must call this immediately after WebContents creation to avoid race |
| 234 // with load. | 234 // with load. |
| 235 delegate_->OnInlineDispositionWebContentsCreated(web_contents); | 235 delegate_->OnInlineDispositionWebContentsCreated(web_contents); |
| 236 | 236 |
| 237 tab_contents_container_.reset(new TabContentsContainerGtk(NULL)); | 237 tab_contents_container_.reset(new TabContentsContainerGtk(NULL)); |
| 238 tab_contents_container_->SetTab(inline_disposition_tab_contents_.get()); | 238 tab_contents_container_->SetTab(inline_disposition_tab_contents_.get()); |
| 239 | 239 |
| 240 inline_disposition_tab_contents_->web_contents()->GetController().LoadURL( | 240 inline_disposition_tab_contents_->web_contents()->GetController().LoadURL( |
| 241 url, content::Referrer(), content::PAGE_TRANSITION_START_PAGE, | 241 url, content::Referrer(), content::PAGE_TRANSITION_START_PAGE, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 AddTitle(sub_contents); | 297 AddTitle(sub_contents); |
| 298 | 298 |
| 299 // Replace the dialog header. | 299 // Replace the dialog header. |
| 300 gtk_label_set_text( | 300 gtk_label_set_text( |
| 301 GTK_LABEL(header_label_), | 301 GTK_LABEL(header_label_), |
| 302 l10n_util::GetStringUTF8(IDS_INTENT_PICKER_NO_SERVICES_TITLE).c_str()); | 302 l10n_util::GetStringUTF8(IDS_INTENT_PICKER_NO_SERVICES_TITLE).c_str()); |
| 303 | 303 |
| 304 // Add the message text. | 304 // Add the message text. |
| 305 GtkWidget* hbox = gtk_hbox_new(FALSE, 0); | 305 GtkWidget* hbox = gtk_hbox_new(FALSE, 0); |
| 306 gtk_box_pack_start(GTK_BOX(sub_contents), hbox, TRUE, TRUE, 0); | 306 gtk_box_pack_start(GTK_BOX(sub_contents), hbox, TRUE, TRUE, 0); |
| 307 GtkThemeService* theme_service = GetThemeService(wrapper_); | 307 GtkThemeService* theme_service = GetThemeService(tab_contents_); |
| 308 GtkWidget* no_service_label = theme_service->BuildLabel( | 308 GtkWidget* no_service_label = theme_service->BuildLabel( |
| 309 l10n_util::GetStringUTF8(IDS_INTENT_PICKER_NO_SERVICES).c_str(), | 309 l10n_util::GetStringUTF8(IDS_INTENT_PICKER_NO_SERVICES).c_str(), |
| 310 ui::kGdkBlack); | 310 ui::kGdkBlack); |
| 311 gtk_label_set_line_wrap(GTK_LABEL(no_service_label), TRUE); | 311 gtk_label_set_line_wrap(GTK_LABEL(no_service_label), TRUE); |
| 312 gtk_misc_set_alignment(GTK_MISC(no_service_label), 0, 0); | 312 gtk_misc_set_alignment(GTK_MISC(no_service_label), 0, 0); |
| 313 // Set the label width to the size of |sub_contents|, which we don't have | 313 // Set the label width to the size of |sub_contents|, which we don't have |
| 314 // access to yet, by calculating the main content width minus borders. | 314 // access to yet, by calculating the main content width minus borders. |
| 315 gtk_util::SetLabelWidth(no_service_label, | 315 gtk_util::SetLabelWidth(no_service_label, |
| 316 kMainContentWidth - 2 * ui::kContentAreaBorder); | 316 kMainContentWidth - 2 * ui::kContentAreaBorder); |
| 317 gtk_box_pack_start(GTK_BOX(hbox), no_service_label, TRUE, TRUE, 0); | 317 gtk_box_pack_start(GTK_BOX(hbox), no_service_label, TRUE, TRUE, 0); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 334 } | 334 } |
| 335 | 335 |
| 336 bool WebIntentPickerGtk::ShouldHaveBorderPadding() const { | 336 bool WebIntentPickerGtk::ShouldHaveBorderPadding() const { |
| 337 return false; | 337 return false; |
| 338 } | 338 } |
| 339 | 339 |
| 340 void WebIntentPickerGtk::Observe(int type, | 340 void WebIntentPickerGtk::Observe(int type, |
| 341 const content::NotificationSource& source, | 341 const content::NotificationSource& source, |
| 342 const content::NotificationDetails& details) { | 342 const content::NotificationDetails& details) { |
| 343 DCHECK_EQ(type, chrome::NOTIFICATION_BROWSER_THEME_CHANGED); | 343 DCHECK_EQ(type, chrome::NOTIFICATION_BROWSER_THEME_CHANGED); |
| 344 GtkThemeService* theme_service = GetThemeService(wrapper_); | 344 GtkThemeService* theme_service = GetThemeService(tab_contents_); |
| 345 if (theme_service->UsingNativeTheme()) | 345 if (theme_service->UsingNativeTheme()) |
| 346 gtk_util::UndoForceFontSize(header_label_); | 346 gtk_util::UndoForceFontSize(header_label_); |
| 347 else | 347 else |
| 348 gtk_util::ForceFontSizePixels(header_label_, kHeaderLabelPixelSize); | 348 gtk_util::ForceFontSizePixels(header_label_, kHeaderLabelPixelSize); |
| 349 | 349 |
| 350 UpdateInstalledServices(); | 350 UpdateInstalledServices(); |
| 351 UpdateSuggestedExtensions(); | 351 UpdateSuggestedExtensions(); |
| 352 } | 352 } |
| 353 | 353 |
| 354 void WebIntentPickerGtk::OnDestroy(GtkWidget* button) { | 354 void WebIntentPickerGtk::OnDestroy(GtkWidget* button) { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 g_list_free(button_list); | 413 g_list_free(button_list); |
| 414 | 414 |
| 415 const WebIntentPickerModel::InstalledService& installed_service = | 415 const WebIntentPickerModel::InstalledService& installed_service = |
| 416 model_->GetInstalledServiceAt(index); | 416 model_->GetInstalledServiceAt(index); |
| 417 | 417 |
| 418 delegate_->OnServiceChosen(installed_service.url, | 418 delegate_->OnServiceChosen(installed_service.url, |
| 419 installed_service.disposition); | 419 installed_service.disposition); |
| 420 } | 420 } |
| 421 | 421 |
| 422 void WebIntentPickerGtk::InitContents() { | 422 void WebIntentPickerGtk::InitContents() { |
| 423 GtkThemeService* theme_service = GetThemeService(wrapper_); | 423 GtkThemeService* theme_service = GetThemeService(tab_contents_); |
| 424 | 424 |
| 425 // Main contents vbox. | 425 // Main contents vbox. |
| 426 contents_ = gtk_vbox_new(FALSE, 0); | 426 contents_ = gtk_vbox_new(FALSE, 0); |
| 427 gtk_widget_set_size_request(contents_, kMainContentWidth, -1); | 427 gtk_widget_set_size_request(contents_, kMainContentWidth, -1); |
| 428 | 428 |
| 429 AddCloseButton(contents_); | 429 AddCloseButton(contents_); |
| 430 GtkWidget* sub_contents = CreateSubContents(contents_); | 430 GtkWidget* sub_contents = CreateSubContents(contents_); |
| 431 AddTitle(sub_contents); | 431 AddTitle(sub_contents); |
| 432 | 432 |
| 433 // Add separation between the installed services list and the app suggestions. | 433 // Add separation between the installed services list and the app suggestions. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 return sub_contents; | 498 return sub_contents; |
| 499 } | 499 } |
| 500 | 500 |
| 501 void WebIntentPickerGtk::AddCloseButton(GtkWidget* containingBox) { | 501 void WebIntentPickerGtk::AddCloseButton(GtkWidget* containingBox) { |
| 502 | 502 |
| 503 // Hbox containing the close button. | 503 // Hbox containing the close button. |
| 504 GtkWidget* close_hbox = gtk_hbox_new(FALSE, 0); | 504 GtkWidget* close_hbox = gtk_hbox_new(FALSE, 0); |
| 505 gtk_box_pack_start(GTK_BOX(containingBox), close_hbox, TRUE, TRUE, 0); | 505 gtk_box_pack_start(GTK_BOX(containingBox), close_hbox, TRUE, TRUE, 0); |
| 506 | 506 |
| 507 close_button_.reset( | 507 close_button_.reset( |
| 508 CustomDrawButton::CloseButton(GetThemeService(wrapper_))); | 508 CustomDrawButton::CloseButton(GetThemeService(tab_contents_))); |
| 509 g_signal_connect(close_button_->widget(), "clicked", | 509 g_signal_connect(close_button_->widget(), "clicked", |
| 510 G_CALLBACK(OnCloseButtonClickThunk), this); | 510 G_CALLBACK(OnCloseButtonClickThunk), this); |
| 511 gtk_widget_set_can_focus(close_button_->widget(), FALSE); | 511 gtk_widget_set_can_focus(close_button_->widget(), FALSE); |
| 512 gtk_box_pack_end(GTK_BOX(close_hbox), close_button_->widget(), | 512 gtk_box_pack_end(GTK_BOX(close_hbox), close_button_->widget(), |
| 513 FALSE, FALSE, 0); | 513 FALSE, FALSE, 0); |
| 514 } | 514 } |
| 515 | 515 |
| 516 void WebIntentPickerGtk::AddTitle(GtkWidget* containingBox) { | 516 void WebIntentPickerGtk::AddTitle(GtkWidget* containingBox) { |
| 517 // Hbox containing the header label. | 517 // Hbox containing the header label. |
| 518 GtkWidget* header_hbox = gtk_hbox_new(FALSE, 0); | 518 GtkWidget* header_hbox = gtk_hbox_new(FALSE, 0); |
| 519 gtk_box_pack_start(GTK_BOX(containingBox), header_hbox, TRUE, TRUE, 0); | 519 gtk_box_pack_start(GTK_BOX(containingBox), header_hbox, TRUE, TRUE, 0); |
| 520 | 520 |
| 521 // Label text will be set in the call to SetActionString(). | 521 // Label text will be set in the call to SetActionString(). |
| 522 header_label_ = GetThemeService(wrapper_)->BuildLabel( | 522 header_label_ = GetThemeService(tab_contents_)->BuildLabel( |
| 523 std::string(), ui::kGdkBlack); | 523 std::string(), ui::kGdkBlack); |
| 524 gtk_util::ForceFontSizePixels(header_label_, kHeaderLabelPixelSize); | 524 gtk_util::ForceFontSizePixels(header_label_, kHeaderLabelPixelSize); |
| 525 gtk_box_pack_start(GTK_BOX(header_hbox), header_label_, TRUE, TRUE, 0); | 525 gtk_box_pack_start(GTK_BOX(header_hbox), header_label_, TRUE, TRUE, 0); |
| 526 gtk_misc_set_alignment(GTK_MISC(header_label_), 0, 0); | 526 gtk_misc_set_alignment(GTK_MISC(header_label_), 0, 0); |
| 527 } | 527 } |
| 528 | 528 |
| 529 void WebIntentPickerGtk::UpdateInstalledServices() { | 529 void WebIntentPickerGtk::UpdateInstalledServices() { |
| 530 gtk_util::RemoveAllChildren(button_vbox_); | 530 gtk_util::RemoveAllChildren(button_vbox_); |
| 531 | 531 |
| 532 if (model_->GetInstalledServiceCount() == 0) { | 532 if (model_->GetInstalledServiceCount() == 0) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 gtk_widget_show(gtk_widget_get_parent(button_vbox_)); | 570 gtk_widget_show(gtk_widget_get_parent(button_vbox_)); |
| 571 } | 571 } |
| 572 | 572 |
| 573 if (model_->GetSuggestedExtensionCount() == 0) | 573 if (model_->GetSuggestedExtensionCount() == 0) |
| 574 gtk_widget_hide(cws_label_); | 574 gtk_widget_hide(cws_label_); |
| 575 else | 575 else |
| 576 gtk_widget_show(cws_label_); | 576 gtk_widget_show(cws_label_); |
| 577 } | 577 } |
| 578 | 578 |
| 579 void WebIntentPickerGtk::UpdateSuggestedExtensions() { | 579 void WebIntentPickerGtk::UpdateSuggestedExtensions() { |
| 580 GtkThemeService* theme_service = GetThemeService(wrapper_); | 580 GtkThemeService* theme_service = GetThemeService(tab_contents_); |
| 581 | 581 |
| 582 gtk_util::RemoveAllChildren(extensions_vbox_); | 582 gtk_util::RemoveAllChildren(extensions_vbox_); |
| 583 | 583 |
| 584 if (model_->GetSuggestedExtensionCount() == 0) { | 584 if (model_->GetSuggestedExtensionCount() == 0) { |
| 585 gtk_widget_hide(gtk_widget_get_parent(extensions_vbox_)); | 585 gtk_widget_hide(gtk_widget_get_parent(extensions_vbox_)); |
| 586 return; | 586 return; |
| 587 } | 587 } |
| 588 | 588 |
| 589 gtk_widget_show(gtk_widget_get_parent(extensions_vbox_)); | 589 gtk_widget_show(gtk_widget_get_parent(extensions_vbox_)); |
| 590 | 590 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 return alignment; | 654 return alignment; |
| 655 } | 655 } |
| 656 | 656 |
| 657 void WebIntentPickerGtk::RemoveThrobber() { | 657 void WebIntentPickerGtk::RemoveThrobber() { |
| 658 GtkWidget* alignment = gtk_widget_get_parent(throbber_->widget()); | 658 GtkWidget* alignment = gtk_widget_get_parent(throbber_->widget()); |
| 659 DCHECK(alignment); | 659 DCHECK(alignment); |
| 660 gtk_container_remove(GTK_CONTAINER(alignment), throbber_->widget()); | 660 gtk_container_remove(GTK_CONTAINER(alignment), throbber_->widget()); |
| 661 gtk_widget_destroy(alignment); | 661 gtk_widget_destroy(alignment); |
| 662 throbber_->Stop(); | 662 throbber_->Stop(); |
| 663 } | 663 } |
| OLD | NEW |