| 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 <gtk/gtk.h> | 5 #include <gtk/gtk.h> |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/extensions/bundle_installer.h" | 10 #include "chrome/browser/extensions/bundle_installer.h" |
| 11 #include "chrome/browser/extensions/extension_install_prompt.h" | 11 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 13 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
| 14 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" | 14 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" |
| 15 #include "chrome/browser/ui/gtk/gtk_util.h" | 15 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 16 #include "chrome/common/extensions/extension.h" | 16 #include "chrome/common/extensions/extension.h" |
| 17 #include "chrome/common/extensions/extension_constants.h" | |
| 18 #include "content/public/browser/page_navigator.h" | 17 #include "content/public/browser/page_navigator.h" |
| 19 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
| 20 #include "content/public/browser/web_contents_view.h" | 19 #include "content/public/browser/web_contents_view.h" |
| 20 #include "extensions/common/extension_urls.h" |
| 21 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
| 22 #include "skia/ext/image_operations.h" | 22 #include "skia/ext/image_operations.h" |
| 23 #include "ui/base/gtk/gtk_hig_constants.h" | 23 #include "ui/base/gtk/gtk_hig_constants.h" |
| 24 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
| 25 #include "ui/base/resource/resource_bundle.h" | 25 #include "ui/base/resource/resource_bundle.h" |
| 26 #include "ui/gfx/gtk_util.h" | 26 #include "ui/gfx/gtk_util.h" |
| 27 | 27 |
| 28 using content::OpenURLParams; | 28 using content::OpenURLParams; |
| 29 using extensions::BundleInstaller; | 29 using extensions::BundleInstaller; |
| 30 | 30 |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 delegate_->InstallUIProceed(); | 386 delegate_->InstallUIProceed(); |
| 387 else | 387 else |
| 388 delegate_->InstallUIAbort(true); | 388 delegate_->InstallUIAbort(true); |
| 389 | 389 |
| 390 gtk_widget_destroy(dialog_); | 390 gtk_widget_destroy(dialog_); |
| 391 delete this; | 391 delete this; |
| 392 } | 392 } |
| 393 | 393 |
| 394 void ExtensionInstallDialog::OnStoreLinkClick(GtkWidget* sender) { | 394 void ExtensionInstallDialog::OnStoreLinkClick(GtkWidget* sender) { |
| 395 GURL store_url( | 395 GURL store_url( |
| 396 extension_urls::GetWebstoreItemDetailURLPrefix() + extension_id_); | 396 extensions::GetWebstoreItemDetailURLPrefix() + extension_id_); |
| 397 navigator_->OpenURL(OpenURLParams( | 397 navigator_->OpenURL(OpenURLParams( |
| 398 store_url, content::Referrer(), NEW_FOREGROUND_TAB, | 398 store_url, content::Referrer(), NEW_FOREGROUND_TAB, |
| 399 content::PAGE_TRANSITION_LINK, false)); | 399 content::PAGE_TRANSITION_LINK, false)); |
| 400 | 400 |
| 401 OnResponse(dialog_, GTK_RESPONSE_CLOSE); | 401 OnResponse(dialog_, GTK_RESPONSE_CLOSE); |
| 402 } | 402 } |
| 403 | 403 |
| 404 GtkWidget* ExtensionInstallDialog::CreateWidgetForIssueAdvice( | 404 GtkWidget* ExtensionInstallDialog::CreateWidgetForIssueAdvice( |
| 405 const IssueAdviceInfoEntry& issue_advice, int pixel_width) { | 405 const IssueAdviceInfoEntry& issue_advice, int pixel_width) { |
| 406 GtkWidget* box = gtk_vbox_new(FALSE, 0); | 406 GtkWidget* box = gtk_vbox_new(FALSE, 0); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 431 new chrome::ExtensionInstallDialog(show_params, delegate, prompt); | 431 new chrome::ExtensionInstallDialog(show_params, delegate, prompt); |
| 432 } | 432 } |
| 433 | 433 |
| 434 } // namespace | 434 } // namespace |
| 435 | 435 |
| 436 // static | 436 // static |
| 437 ExtensionInstallPrompt::ShowDialogCallback | 437 ExtensionInstallPrompt::ShowDialogCallback |
| 438 ExtensionInstallPrompt::GetDefaultShowDialogCallback() { | 438 ExtensionInstallPrompt::GetDefaultShowDialogCallback() { |
| 439 return base::Bind(&ShowExtensionInstallDialogImpl); | 439 return base::Bind(&ShowExtensionInstallDialogImpl); |
| 440 } | 440 } |
| OLD | NEW |