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

Side by Side Diff: chrome/browser/ui/views/translate/translate_bubble_view.cc

Issue 1904753002: MenuButton: support Mac look & feel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add basic tests Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/gfx/BUILD.gn » ('j') | ui/gfx/gfx.gyp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 static_cast<size_t>(DenialComboboxIndex::MENU_SIZE)); 409 static_cast<size_t>(DenialComboboxIndex::MENU_SIZE));
410 items[static_cast<size_t>(DenialComboboxIndex::DONT_TRANSLATE)] = 410 items[static_cast<size_t>(DenialComboboxIndex::DONT_TRANSLATE)] =
411 l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_DENY); 411 l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_DENY);
412 items[static_cast<size_t>(DenialComboboxIndex::NEVER_TRANSLATE_LANGUAGE)] = 412 items[static_cast<size_t>(DenialComboboxIndex::NEVER_TRANSLATE_LANGUAGE)] =
413 l10n_util::GetStringFUTF16(IDS_TRANSLATE_BUBBLE_NEVER_TRANSLATE_LANG, 413 l10n_util::GetStringFUTF16(IDS_TRANSLATE_BUBBLE_NEVER_TRANSLATE_LANG,
414 original_language_name); 414 original_language_name);
415 items[static_cast<size_t>(DenialComboboxIndex::NEVER_TRANSLATE_SITE)] = 415 items[static_cast<size_t>(DenialComboboxIndex::NEVER_TRANSLATE_SITE)] =
416 l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_NEVER_TRANSLATE_SITE); 416 l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_NEVER_TRANSLATE_SITE);
417 417
418 denial_combobox_model_.reset(new ui::SimpleComboboxModel(items)); 418 denial_combobox_model_.reset(new ui::SimpleComboboxModel(items));
419 denial_combobox_ = new views::Combobox(denial_combobox_model_.get()); 419 denial_combobox_ = new views::Combobox(denial_combobox_model_.get(),
420 views::Combobox::STYLE_ACTION);
tapted 2016/05/09 08:01:35 heads-up: this will need a rebase
420 denial_combobox_->set_id(COMBOBOX_ID_DENIAL); 421 denial_combobox_->set_id(COMBOBOX_ID_DENIAL);
421 denial_combobox_->set_listener(this); 422 denial_combobox_->set_listener(this);
422 denial_combobox_->SetStyle(views::Combobox::STYLE_ACTION);
423 423
424 views::View* view = new views::View(); 424 views::View* view = new views::View();
425 views::GridLayout* layout = new views::GridLayout(view); 425 views::GridLayout* layout = new views::GridLayout(view);
426 view->SetLayoutManager(layout); 426 view->SetLayoutManager(layout);
427 427
428 using views::GridLayout; 428 using views::GridLayout;
429 429
430 enum { 430 enum {
431 COLUMN_SET_ID_MESSAGE, 431 COLUMN_SET_ID_MESSAGE,
432 COLUMN_SET_ID_CONTENT, 432 COLUMN_SET_ID_CONTENT,
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 base::string16 label; 740 base::string16 label;
741 if (model_->IsPageTranslatedInCurrentLanguages()) 741 if (model_->IsPageTranslatedInCurrentLanguages())
742 label = l10n_util::GetStringUTF16(IDS_DONE); 742 label = l10n_util::GetStringUTF16(IDS_DONE);
743 else 743 else
744 label = l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ACCEPT); 744 label = l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ACCEPT);
745 advanced_done_button_->SetText(label); 745 advanced_done_button_->SetText(label);
746 advanced_done_button_->SizeToPreferredSize(); 746 advanced_done_button_->SizeToPreferredSize();
747 if (advanced_view_) 747 if (advanced_view_)
748 advanced_view_->Layout(); 748 advanced_view_->Layout();
749 } 749 }
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/BUILD.gn » ('j') | ui/gfx/gfx.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698