| 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/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/extensions/extension_browser_event_router.h" | 10 #include "chrome/browser/extensions/extension_browser_event_router.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/common/extensions/extension_action.h" | 22 #include "chrome/common/extensions/extension_action.h" |
| 23 #include "chrome/common/extensions/extension_resource.h" | 23 #include "chrome/common/extensions/extension_resource.h" |
| 24 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
| 25 #include "content/browser/renderer_host/render_view_host.h" | 25 #include "content/browser/renderer_host/render_view_host.h" |
| 26 #include "content/browser/renderer_host/render_widget_host_view.h" | 26 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 27 #include "content/browser/tab_contents/tab_contents.h" | 27 #include "content/browser/tab_contents/tab_contents.h" |
| 28 #include "content/common/notification_source.h" | 28 #include "content/common/notification_source.h" |
| 29 #include "content/common/notification_type.h" | 29 #include "content/common/notification_type.h" |
| 30 #include "grit/app_resources.h" | 30 #include "grit/app_resources.h" |
| 31 #include "grit/generated_resources.h" | 31 #include "grit/generated_resources.h" |
| 32 #include "grit/theme_resources.h" |
| 33 #include "grit/theme_resources_standard.h" |
| 32 #include "third_party/skia/include/core/SkBitmap.h" | 34 #include "third_party/skia/include/core/SkBitmap.h" |
| 33 #include "third_party/skia/include/effects/SkGradientShader.h" | 35 #include "third_party/skia/include/effects/SkGradientShader.h" |
| 34 #include "ui/base/accessibility/accessible_view_state.h" | 36 #include "ui/base/accessibility/accessible_view_state.h" |
| 35 #include "ui/base/animation/slide_animation.h" | 37 #include "ui/base/animation/slide_animation.h" |
| 36 #include "ui/base/l10n/l10n_util.h" | 38 #include "ui/base/l10n/l10n_util.h" |
| 37 #include "ui/base/resource/resource_bundle.h" | 39 #include "ui/base/resource/resource_bundle.h" |
| 38 #include "ui/base/theme_provider.h" | 40 #include "ui/base/theme_provider.h" |
| 39 #include "ui/gfx/canvas.h" | 41 #include "ui/gfx/canvas.h" |
| 40 #include "ui/gfx/canvas_skia.h" | 42 #include "ui/gfx/canvas_skia.h" |
| 41 #include "views/controls/button/menu_button.h" | 43 #include "views/controls/button/menu_button.h" |
| 42 #include "views/controls/button/text_button.h" | 44 #include "views/controls/button/text_button.h" |
| 43 #include "views/controls/menu/menu_2.h" | 45 #include "views/controls/menu/menu_2.h" |
| 44 #include "views/drag_utils.h" | 46 #include "views/drag_utils.h" |
| 45 #include "views/metrics.h" | 47 #include "views/metrics.h" |
| 46 #include "views/window/window.h" | 48 #include "views/window/window.h" |
| 47 | 49 |
| 48 #include "grit/theme_resources.h" | |
| 49 | |
| 50 // Horizontal spacing between most items in the container, as well as after the | 50 // Horizontal spacing between most items in the container, as well as after the |
| 51 // last item or chevron (if visible). | 51 // last item or chevron (if visible). |
| 52 static const int kItemSpacing = ToolbarView::kStandardSpacing; | 52 static const int kItemSpacing = ToolbarView::kStandardSpacing; |
| 53 // Horizontal spacing before the chevron (if visible). | 53 // Horizontal spacing before the chevron (if visible). |
| 54 static const int kChevronSpacing = kItemSpacing - 2; | 54 static const int kChevronSpacing = kItemSpacing - 2; |
| 55 | 55 |
| 56 // static | 56 // static |
| 57 bool BrowserActionsContainer::disable_animations_during_testing_ = false; | 57 bool BrowserActionsContainer::disable_animations_during_testing_ = false; |
| 58 | 58 |
| 59 //////////////////////////////////////////////////////////////////////////////// | 59 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 } | 1093 } |
| 1094 } | 1094 } |
| 1095 | 1095 |
| 1096 bool BrowserActionsContainer::ShouldDisplayBrowserAction( | 1096 bool BrowserActionsContainer::ShouldDisplayBrowserAction( |
| 1097 const Extension* extension) { | 1097 const Extension* extension) { |
| 1098 // Only display incognito-enabled extensions while in incognito mode. | 1098 // Only display incognito-enabled extensions while in incognito mode. |
| 1099 return | 1099 return |
| 1100 (!profile_->IsOffTheRecord() || | 1100 (!profile_->IsOffTheRecord() || |
| 1101 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id())); | 1101 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id())); |
| 1102 } | 1102 } |
| OLD | NEW |