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

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

Issue 22694006: Infobar system refactor. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years 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) 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/views/infobars/before_translate_infobar.h" 5 #include "chrome/browser/ui/views/infobars/before_translate_infobar.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/translate/options_menu_model.h" 8 #include "chrome/browser/translate/options_menu_model.h"
9 #include "chrome/browser/translate/translate_infobar_delegate.h" 9 #include "chrome/browser/translate/translate_infobar_delegate.h"
10 #include "chrome/browser/ui/views/infobars/translate_language_menu_model.h" 10 #include "chrome/browser/ui/views/infobars/translate_language_menu_model.h"
11 #include "grit/generated_resources.h" 11 #include "grit/generated_resources.h"
12 #include "ui/base/l10n/l10n_util.h" 12 #include "ui/base/l10n/l10n_util.h"
13 #include "ui/views/controls/button/label_button.h" 13 #include "ui/views/controls/button/label_button.h"
14 #include "ui/views/controls/button/menu_button.h" 14 #include "ui/views/controls/button/menu_button.h"
15 #include "ui/views/controls/label.h" 15 #include "ui/views/controls/label.h"
16 #include "ui/views/controls/menu/menu_item_view.h" 16 #include "ui/views/controls/menu/menu_item_view.h"
17 17
18 BeforeTranslateInfoBar::BeforeTranslateInfoBar( 18 BeforeTranslateInfoBar::BeforeTranslateInfoBar(
19 InfoBarService* owner, 19 scoped_ptr<TranslateInfoBarDelegate> delegate)
20 TranslateInfoBarDelegate* delegate) 20 : TranslateInfoBarBase(delegate.Pass()),
21 : TranslateInfoBarBase(owner, delegate),
22 label_1_(NULL), 21 label_1_(NULL),
23 label_2_(NULL), 22 label_2_(NULL),
24 language_menu_button_(NULL), 23 language_menu_button_(NULL),
25 accept_button_(NULL), 24 accept_button_(NULL),
26 deny_button_(NULL), 25 deny_button_(NULL),
27 never_translate_button_(NULL), 26 never_translate_button_(NULL),
28 always_translate_button_(NULL), 27 always_translate_button_(NULL),
29 options_menu_button_(NULL) { 28 options_menu_button_(NULL) {
30 } 29 }
31 30
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 return; // We're closing; don't call anything, it might access the owner. 188 return; // We're closing; don't call anything, it might access the owner.
190 if (source == language_menu_button_) { 189 if (source == language_menu_button_) {
191 RunMenuAt(language_menu_model_.get(), language_menu_button_, 190 RunMenuAt(language_menu_model_.get(), language_menu_button_,
192 views::MenuItemView::TOPLEFT); 191 views::MenuItemView::TOPLEFT);
193 } else { 192 } else {
194 DCHECK_EQ(options_menu_button_, source); 193 DCHECK_EQ(options_menu_button_, source);
195 RunMenuAt(options_menu_model_.get(), options_menu_button_, 194 RunMenuAt(options_menu_model_.get(), options_menu_button_,
196 views::MenuItemView::TOPRIGHT); 195 views::MenuItemView::TOPRIGHT);
197 } 196 }
198 } 197 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/before_translate_infobar.h ('k') | chrome/browser/ui/views/infobars/confirm_infobar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698