OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/translate/translate_bubble_view.h" | 5 #include "chrome/browser/ui/views/translate/translate_bubble_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 } | 254 } |
255 | 255 |
256 void TranslateBubbleView::OnPerformAction(views::Combobox* combobox) { | 256 void TranslateBubbleView::OnPerformAction(views::Combobox* combobox) { |
257 HandleComboboxPerformAction(static_cast<ComboboxID>(combobox->id())); | 257 HandleComboboxPerformAction(static_cast<ComboboxID>(combobox->id())); |
258 } | 258 } |
259 | 259 |
260 void TranslateBubbleView::LinkClicked(views::Link* source, int event_flags) { | 260 void TranslateBubbleView::LinkClicked(views::Link* source, int event_flags) { |
261 HandleLinkClicked(static_cast<LinkID>(source->id())); | 261 HandleLinkClicked(static_cast<LinkID>(source->id())); |
262 } | 262 } |
263 | 263 |
264 void TranslateBubbleView::WebContentsDestroyed( | 264 void TranslateBubbleView::WebContentsDestroyed() { |
265 content::WebContents* web_contents) { | |
266 GetWidget()->CloseNow(); | 265 GetWidget()->CloseNow(); |
267 } | 266 } |
268 | 267 |
269 TranslateBubbleModel::ViewState TranslateBubbleView::GetViewState() const { | 268 TranslateBubbleModel::ViewState TranslateBubbleView::GetViewState() const { |
270 return model_->GetViewState(); | 269 return model_->GetViewState(); |
271 } | 270 } |
272 | 271 |
273 TranslateBubbleView::TranslateBubbleView( | 272 TranslateBubbleView::TranslateBubbleView( |
274 views::View* anchor_view, | 273 views::View* anchor_view, |
275 scoped_ptr<TranslateBubbleModel> model, | 274 scoped_ptr<TranslateBubbleModel> model, |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 model_->ShouldAlwaysTranslate()); | 765 model_->ShouldAlwaysTranslate()); |
767 } | 766 } |
768 | 767 |
769 base::string16 label; | 768 base::string16 label; |
770 if (model_->IsPageTranslatedInCurrentLanguages()) | 769 if (model_->IsPageTranslatedInCurrentLanguages()) |
771 label = l10n_util::GetStringUTF16(IDS_DONE); | 770 label = l10n_util::GetStringUTF16(IDS_DONE); |
772 else | 771 else |
773 label = l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ACCEPT); | 772 label = l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ACCEPT); |
774 advanced_done_button_->SetText(label); | 773 advanced_done_button_->SetText(label); |
775 } | 774 } |
OLD | NEW |