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

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

Issue 10827271: Replace views::Event with ui::Event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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) 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/after_translate_infobar.h" 5 #include "chrome/browser/ui/views/infobars/after_translate_infobar.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/translate/translate_infobar_delegate.h" 8 #include "chrome/browser/translate/translate_infobar_delegate.h"
9 #include "grit/generated_resources.h" 9 #include "grit/generated_resources.h"
10 #include "ui/base/l10n/l10n_util.h" 10 #include "ui/base/l10n/l10n_util.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 TranslateInfoBarBase::ViewHierarchyChanged(is_add, parent, child); 118 TranslateInfoBarBase::ViewHierarchyChanged(is_add, parent, child);
119 119
120 // These must happen after adding all children because they trigger layout, 120 // These must happen after adding all children because they trigger layout,
121 // which assumes that particular children (e.g. the close button) have already 121 // which assumes that particular children (e.g. the close button) have already
122 // been added. 122 // been added.
123 OriginalLanguageChanged(); 123 OriginalLanguageChanged();
124 TargetLanguageChanged(); 124 TargetLanguageChanged();
125 } 125 }
126 126
127 void AfterTranslateInfoBar::ButtonPressed(views::Button* sender, 127 void AfterTranslateInfoBar::ButtonPressed(views::Button* sender,
128 const views::Event& event) { 128 const ui::Event& event) {
129 if (!owned()) 129 if (!owned())
130 return; // We're closing; don't call anything, it might access the owner. 130 return; // We're closing; don't call anything, it might access the owner.
131 if (sender == revert_button_) 131 if (sender == revert_button_)
132 GetDelegate()->RevertTranslation(); 132 GetDelegate()->RevertTranslation();
133 else 133 else
134 TranslateInfoBarBase::ButtonPressed(sender, event); 134 TranslateInfoBarBase::ButtonPressed(sender, event);
135 } 135 }
136 136
137 int AfterTranslateInfoBar::ContentMinimumWidth() const { 137 int AfterTranslateInfoBar::ContentMinimumWidth() const {
138 return 138 return
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 menu_model = &target_language_menu_model_; 178 menu_model = &target_language_menu_model_;
179 button = target_language_menu_button_; 179 button = target_language_menu_button_;
180 } else { 180 } else {
181 DCHECK_EQ(options_menu_button_, source); 181 DCHECK_EQ(options_menu_button_, source);
182 menu_model = &options_menu_model_; 182 menu_model = &options_menu_model_;
183 button = options_menu_button_; 183 button = options_menu_button_;
184 anchor = views::MenuItemView::TOPRIGHT; 184 anchor = views::MenuItemView::TOPRIGHT;
185 } 185 }
186 RunMenuAt(menu_model, button, anchor); 186 RunMenuAt(menu_model, button, anchor);
187 } 187 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698