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

Side by Side Diff: chrome/browser/ui/views/infobars/translate_language_menu_model.cc

Issue 284313008: Move TranslateInfoBarDelegate and OptionsMenuModel to the Translate component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + review comments Created 6 years, 6 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/views/infobars/translate_language_menu_model.h" 5 #include "chrome/browser/ui/views/infobars/translate_language_menu_model.h"
6 6
7 #include "chrome/browser/translate/translate_infobar_delegate.h"
8 #include "chrome/browser/ui/views/infobars/translate_infobar_base.h" 7 #include "chrome/browser/ui/views/infobars/translate_infobar_base.h"
8 #include "components/translate/core/browser/translate_infobar_delegate.h"
9 9
10 TranslateLanguageMenuModel::TranslateLanguageMenuModel( 10 TranslateLanguageMenuModel::TranslateLanguageMenuModel(
11 LanguageType language_type, 11 LanguageType language_type,
12 TranslateInfoBarDelegate* infobar_delegate, 12 TranslateInfoBarDelegate* infobar_delegate,
13 TranslateInfoBarBase* infobar, 13 TranslateInfoBarBase* infobar,
14 views::MenuButton* button, 14 views::MenuButton* button,
15 bool translate_on_change) 15 bool translate_on_change)
16 : ui::SimpleMenuModel(this), 16 : ui::SimpleMenuModel(this),
17 language_type_(language_type), 17 language_type_(language_type),
18 infobar_delegate_(infobar_delegate), 18 infobar_delegate_(infobar_delegate),
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 infobar_delegate_->language_name_at(GetLanguageIndex())); 55 infobar_delegate_->language_name_at(GetLanguageIndex()));
56 if (translate_on_change_) 56 if (translate_on_change_)
57 infobar_delegate_->Translate(); 57 infobar_delegate_->Translate();
58 } 58 }
59 59
60 size_t TranslateLanguageMenuModel::GetLanguageIndex() const { 60 size_t TranslateLanguageMenuModel::GetLanguageIndex() const {
61 return (language_type_ == ORIGINAL) ? 61 return (language_type_ == ORIGINAL) ?
62 infobar_delegate_->original_language_index() : 62 infobar_delegate_->original_language_index() :
63 infobar_delegate_->target_language_index(); 63 infobar_delegate_->target_language_index();
64 } 64 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698