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

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

Issue 2824503003: fix menu alignment issue (Closed)
Patch Set: Created 3 years, 8 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 | no next file » | no next file with comments »
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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 denial_menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); 273 denial_menu_model_->AddSeparator(ui::NORMAL_SEPARATOR);
274 274
275 denial_menu_model_->AddItemWithStringId( 275 denial_menu_model_->AddItemWithStringId(
276 DenialMenuItem::NEVER_TRANSLATE_SITE, 276 DenialMenuItem::NEVER_TRANSLATE_SITE,
277 IDS_TRANSLATE_BUBBLE_NEVER_TRANSLATE_SITE); 277 IDS_TRANSLATE_BUBBLE_NEVER_TRANSLATE_SITE);
278 278
279 denial_menu_runner_.reset(new views::MenuRunner(denial_menu_model_.get(), 279 denial_menu_runner_.reset(new views::MenuRunner(denial_menu_model_.get(),
280 views::MenuRunner::ASYNC)); 280 views::MenuRunner::ASYNC));
281 } 281 }
282 gfx::Rect screen_bounds = source->GetBoundsInScreen(); 282 gfx::Rect screen_bounds = source->GetBoundsInScreen();
283 screen_bounds.Inset(source->GetInsets());
284 denial_menu_runner_->RunMenuAt(source->GetWidget(), source, screen_bounds, 283 denial_menu_runner_->RunMenuAt(source->GetWidget(), source, screen_bounds,
285 views::MENU_ANCHOR_TOPRIGHT, 284 views::MENU_ANCHOR_TOPRIGHT,
286 ui::MENU_SOURCE_MOUSE); 285 ui::MENU_SOURCE_MOUSE);
287 } 286 }
288 287
289 bool TranslateBubbleView::IsCommandIdChecked(int command_id) const { 288 bool TranslateBubbleView::IsCommandIdChecked(int command_id) const {
290 return false; 289 return false;
291 } 290 }
292 291
293 bool TranslateBubbleView::IsCommandIdEnabled(int command_id) const { 292 bool TranslateBubbleView::IsCommandIdEnabled(int command_id) const {
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 base::string16 label; 940 base::string16 label;
942 if (model_->IsPageTranslatedInCurrentLanguages()) 941 if (model_->IsPageTranslatedInCurrentLanguages())
943 label = l10n_util::GetStringUTF16(IDS_DONE); 942 label = l10n_util::GetStringUTF16(IDS_DONE);
944 else 943 else
945 label = l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ACCEPT); 944 label = l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ACCEPT);
946 advanced_done_button_->SetText(label); 945 advanced_done_button_->SetText(label);
947 advanced_done_button_->SizeToPreferredSize(); 946 advanced_done_button_->SizeToPreferredSize();
948 if (advanced_view_) 947 if (advanced_view_)
949 advanced_view_->Layout(); 948 advanced_view_->Layout();
950 } 949 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698