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

Side by Side Diff: chrome/browser/views/wrench_menu.cc

Issue 3017033: Mirror wrench menu corner alignment in RTL mode.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 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
« 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/views/wrench_menu.h" 5 #include "chrome/browser/views/wrench_menu.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 PopulateMenu(root_.get(), model, &next_id); 556 PopulateMenu(root_.get(), model, &next_id);
557 } 557 }
558 558
559 void WrenchMenu::RunMenu(views::MenuButton* host) { 559 void WrenchMenu::RunMenu(views::MenuButton* host) {
560 gfx::Point screen_loc; 560 gfx::Point screen_loc;
561 views::View::ConvertPointToScreen(host, &screen_loc); 561 views::View::ConvertPointToScreen(host, &screen_loc);
562 // Subtract 1 from the height to make the popup flush with the button border. 562 // Subtract 1 from the height to make the popup flush with the button border.
563 gfx::Rect bounds(screen_loc.x(), screen_loc.y(), host->width(), 563 gfx::Rect bounds(screen_loc.x(), screen_loc.y(), host->width(),
564 host->height() - 1); 564 host->height() - 1);
565 root_->RunMenuAt(host->GetWindow()->GetNativeWindow(), host, bounds, 565 root_->RunMenuAt(host->GetWindow()->GetNativeWindow(), host, bounds,
566 MenuItemView::TOPRIGHT, true); 566 base::i18n::IsRTL() ? MenuItemView::TOPLEFT : MenuItemView::TOPRIGHT,
567 true);
567 if (selected_menu_model_) 568 if (selected_menu_model_)
568 selected_menu_model_->ActivatedAt(selected_index_); 569 selected_menu_model_->ActivatedAt(selected_index_);
569 } 570 }
570 571
571 bool WrenchMenu::IsItemChecked(int id) const { 572 bool WrenchMenu::IsItemChecked(int id) const {
572 const Entry& entry = id_to_entry_.find(id)->second; 573 const Entry& entry = id_to_entry_.find(id)->second;
573 return entry.first->IsItemCheckedAt(entry.second); 574 return entry.first->IsItemCheckedAt(entry.second);
574 } 575 }
575 576
576 bool WrenchMenu::IsCommandEnabled(int id) const { 577 bool WrenchMenu::IsCommandEnabled(int id) const {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 } 700 }
700 701
701 return menu_item; 702 return menu_item;
702 } 703 }
703 704
704 void WrenchMenu::CancelAndEvaluate(MenuModel* model, int index) { 705 void WrenchMenu::CancelAndEvaluate(MenuModel* model, int index) {
705 selected_menu_model_ = model; 706 selected_menu_model_ = model;
706 selected_index_ = index; 707 selected_index_ = index;
707 root_->Cancel(); 708 root_->Cancel();
708 } 709 }
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