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

Side by Side Diff: chrome/browser/ui/views/browser_actions_container.cc

Issue 6334152: Clean up RTL methods.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser_actions_container.h" 5 #include "chrome/browser/ui/views/browser_actions_container.h"
6 6
7 #include "base/stl_util-inl.h" 7 #include "base/stl_util-inl.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/browser_window.h" 10 #include "chrome/browser/browser_window.h"
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 if (!data.Read(event.GetData())) 702 if (!data.Read(event.GetData()))
703 return ui::DragDropTypes::DRAG_NONE; 703 return ui::DragDropTypes::DRAG_NONE;
704 704
705 // Make sure we have the same view as we started with. 705 // Make sure we have the same view as we started with.
706 DCHECK_EQ(browser_action_views_[data.index()]->button()->extension()->id(), 706 DCHECK_EQ(browser_action_views_[data.index()]->button()->extension()->id(),
707 data.id()); 707 data.id());
708 DCHECK(model_); 708 DCHECK(model_);
709 709
710 size_t i = 0; 710 size_t i = 0;
711 for (; i < browser_action_views_.size(); ++i) { 711 for (; i < browser_action_views_.size(); ++i) {
712 int view_x = 712 int view_x = browser_action_views_[i]->GetMirroredBounds().x();
713 browser_action_views_[i]->GetBounds(APPLY_MIRRORING_TRANSFORMATION).x();
714 if (!browser_action_views_[i]->IsVisible() || 713 if (!browser_action_views_[i]->IsVisible() ||
715 (base::i18n::IsRTL() ? (view_x < drop_indicator_position_) : 714 (base::i18n::IsRTL() ? (view_x < drop_indicator_position_) :
716 (view_x >= drop_indicator_position_))) { 715 (view_x >= drop_indicator_position_))) {
717 // We have reached the end of the visible icons or found one that has a 716 // We have reached the end of the visible icons or found one that has a
718 // higher x position than the drop point. 717 // higher x position than the drop point.
719 break; 718 break;
720 } 719 }
721 } 720 }
722 721
723 // |i| now points to the item to the right of the drop indicator*, which is 722 // |i| now points to the item to the right of the drop indicator*, which is
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 AnimationEnded(resize_animation_.get()); 1096 AnimationEnded(resize_animation_.get());
1098 } 1097 }
1099 } 1098 }
1100 1099
1101 bool BrowserActionsContainer::ShouldDisplayBrowserAction( 1100 bool BrowserActionsContainer::ShouldDisplayBrowserAction(
1102 const Extension* extension) { 1101 const Extension* extension) {
1103 // Only display incognito-enabled extensions while in incognito mode. 1102 // Only display incognito-enabled extensions while in incognito mode.
1104 return (!profile_->IsOffTheRecord() || 1103 return (!profile_->IsOffTheRecord() ||
1105 profile_->GetExtensionService()->IsIncognitoEnabled(extension)); 1104 profile_->GetExtensionService()->IsIncognitoEnabled(extension));
1106 } 1105 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmark_bar_view.cc ('k') | chrome/browser/ui/views/constrained_window_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698