| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "ui/base/resource/resource_bundle.h" | 42 #include "ui/base/resource/resource_bundle.h" |
| 43 #include "ui/base/theme_provider.h" | 43 #include "ui/base/theme_provider.h" |
| 44 #include "ui/gfx/canvas.h" | 44 #include "ui/gfx/canvas.h" |
| 45 #include "ui/gfx/canvas_skia.h" | 45 #include "ui/gfx/canvas_skia.h" |
| 46 #include "ui/views/controls/button/menu_button.h" | 46 #include "ui/views/controls/button/menu_button.h" |
| 47 #include "ui/views/controls/button/text_button.h" | 47 #include "ui/views/controls/button/text_button.h" |
| 48 #include "ui/views/controls/menu/menu_item_view.h" | 48 #include "ui/views/controls/menu/menu_item_view.h" |
| 49 #include "ui/views/controls/menu/menu_model_adapter.h" | 49 #include "ui/views/controls/menu/menu_model_adapter.h" |
| 50 #include "ui/views/controls/menu/menu_runner.h" | 50 #include "ui/views/controls/menu/menu_runner.h" |
| 51 #include "ui/views/controls/resize_area.h" | 51 #include "ui/views/controls/resize_area.h" |
| 52 #include "views/drag_utils.h" | 52 #include "ui/views/drag_utils.h" |
| 53 #include "views/metrics.h" | 53 #include "ui/views/metrics.h" |
| 54 | 54 |
| 55 // Horizontal spacing between most items in the container, as well as after the | 55 // Horizontal spacing between most items in the container, as well as after the |
| 56 // last item or chevron (if visible). | 56 // last item or chevron (if visible). |
| 57 static const int kItemSpacing = ToolbarView::kStandardSpacing; | 57 static const int kItemSpacing = ToolbarView::kStandardSpacing; |
| 58 // Horizontal spacing before the chevron (if visible). | 58 // Horizontal spacing before the chevron (if visible). |
| 59 static const int kChevronSpacing = kItemSpacing - 2; | 59 static const int kChevronSpacing = kItemSpacing - 2; |
| 60 | 60 |
| 61 // static | 61 // static |
| 62 bool BrowserActionsContainer::disable_animations_during_testing_ = false; | 62 bool BrowserActionsContainer::disable_animations_during_testing_ = false; |
| 63 | 63 |
| (...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 } | 1096 } |
| 1097 } | 1097 } |
| 1098 | 1098 |
| 1099 bool BrowserActionsContainer::ShouldDisplayBrowserAction( | 1099 bool BrowserActionsContainer::ShouldDisplayBrowserAction( |
| 1100 const Extension* extension) { | 1100 const Extension* extension) { |
| 1101 // Only display incognito-enabled extensions while in incognito mode. | 1101 // Only display incognito-enabled extensions while in incognito mode. |
| 1102 return | 1102 return |
| 1103 (!profile_->IsOffTheRecord() || | 1103 (!profile_->IsOffTheRecord() || |
| 1104 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id())); | 1104 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id())); |
| 1105 } | 1105 } |
| OLD | NEW |