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

Unified Diff: chrome/browser/translate/options_menu_model.cc

Issue 292513002: Remove dependency of TranslateInfobarDelegate on chrome/ and content/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 6 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/translate/translate_infobar_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/translate/options_menu_model.cc
diff --git a/chrome/browser/translate/options_menu_model.cc b/chrome/browser/translate/options_menu_model.cc
index 6422f1673cbfc61612ed6b50c2839030c66a05f4..9b16323ce65869bc059537b180527a349776bc15 100644
--- a/chrome/browser/translate/options_menu_model.cc
+++ b/chrome/browser/translate/options_menu_model.cc
@@ -7,23 +7,28 @@
#include "base/metrics/histogram.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/translate/translate_infobar_delegate.h"
-#include "chrome/common/url_constants.h"
-#include "content/public/browser/web_contents.h"
+#include "components/translate/core/browser/translate_driver.h"
#include "grit/component_strings.h"
#include "grit/locale_settings.h"
#include "ui/base/l10n/l10n_util.h"
-using content::NavigationEntry;
-using content::OpenURLParams;
-using content::Referrer;
-using content::WebContents;
+namespace {
+
+const char kAboutGoogleTranslateURL[] =
+#if defined(OS_CHROMEOS)
+ "https://support.google.com/chromeos/?p=ib_translation_bar";
+#else
+ "https://support.google.com/chrome/?p=ib_translation_bar";
+#endif
+
+} // namespace
OptionsMenuModel::OptionsMenuModel(
TranslateInfoBarDelegate* translate_delegate)
: ui::SimpleMenuModel(this),
translate_infobar_delegate_(translate_delegate) {
// |translate_delegate| must already be owned.
- DCHECK(translate_infobar_delegate_->GetWebContents());
+ DCHECK(translate_infobar_delegate_->GetTranslateDriver());
base::string16 original_language = translate_delegate->language_name_at(
translate_delegate->original_language_index());
@@ -121,13 +126,10 @@ void OptionsMenuModel::ExecuteCommand(int command_id, int event_flags) {
break;
case IDC_TRANSLATE_OPTIONS_ABOUT: {
- WebContents* web_contents = translate_infobar_delegate_->GetWebContents();
- if (web_contents) {
- OpenURLParams params(
- GURL(chrome::kAboutGoogleTranslateURL), Referrer(),
- NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false);
- web_contents->OpenURL(params);
- }
+ TranslateDriver* translate_driver =
+ translate_infobar_delegate_->GetTranslateDriver();
+ if (translate_driver)
+ translate_driver->OpenUrlInNewTab(GURL(kAboutGoogleTranslateURL));
break;
}
« no previous file with comments | « no previous file | chrome/browser/translate/translate_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698