| OLD | NEW |
| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 // dragging (like we do for tab dragging). | 838 // dragging (like we do for tab dragging). |
| 839 if (drop_indicator_position_ > -1) { | 839 if (drop_indicator_position_ > -1) { |
| 840 // The two-pixel width drop indicator. | 840 // The two-pixel width drop indicator. |
| 841 static const int kDropIndicatorWidth = 2; | 841 static const int kDropIndicatorWidth = 2; |
| 842 gfx::Rect indicator_bounds( | 842 gfx::Rect indicator_bounds( |
| 843 drop_indicator_position_ - (kDropIndicatorWidth / 2), | 843 drop_indicator_position_ - (kDropIndicatorWidth / 2), |
| 844 ToolbarView::kVertSpacing, kDropIndicatorWidth, IconHeight()); | 844 ToolbarView::kVertSpacing, kDropIndicatorWidth, IconHeight()); |
| 845 | 845 |
| 846 // Color of the drop indicator. | 846 // Color of the drop indicator. |
| 847 static const SkColor kDropIndicatorColor = SK_ColorBLACK; | 847 static const SkColor kDropIndicatorColor = SK_ColorBLACK; |
| 848 canvas->FillRectInt(kDropIndicatorColor, indicator_bounds.x(), | 848 canvas->FillRect(kDropIndicatorColor, indicator_bounds); |
| 849 indicator_bounds.y(), indicator_bounds.width(), | |
| 850 indicator_bounds.height()); | |
| 851 } | 849 } |
| 852 } | 850 } |
| 853 | 851 |
| 854 void BrowserActionsContainer::OnThemeChanged() { | 852 void BrowserActionsContainer::OnThemeChanged() { |
| 855 LoadImages(); | 853 LoadImages(); |
| 856 } | 854 } |
| 857 | 855 |
| 858 void BrowserActionsContainer::ViewHierarchyChanged(bool is_add, | 856 void BrowserActionsContainer::ViewHierarchyChanged(bool is_add, |
| 859 views::View* parent, | 857 views::View* parent, |
| 860 views::View* child) { | 858 views::View* child) { |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 } | 1100 } |
| 1103 } | 1101 } |
| 1104 | 1102 |
| 1105 bool BrowserActionsContainer::ShouldDisplayBrowserAction( | 1103 bool BrowserActionsContainer::ShouldDisplayBrowserAction( |
| 1106 const Extension* extension) { | 1104 const Extension* extension) { |
| 1107 // Only display incognito-enabled extensions while in incognito mode. | 1105 // Only display incognito-enabled extensions while in incognito mode. |
| 1108 return | 1106 return |
| 1109 (!profile_->IsOffTheRecord() || | 1107 (!profile_->IsOffTheRecord() || |
| 1110 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id())); | 1108 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id())); |
| 1111 } | 1109 } |
| OLD | NEW |