OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ui/views/style/platform_style.h" | 5 #include "ui/views/style/platform_style.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "ui/base/material_design/material_design_controller.h" | 8 #include "ui/base/material_design/material_design_controller.h" |
9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
10 #include "ui/resources/grit/ui_resources.h" | 10 #include "ui/resources/grit/ui_resources.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 scoped_ptr<LabelButtonBorder> border(new views::LabelButtonBorder()); | 46 scoped_ptr<LabelButtonBorder> border(new views::LabelButtonBorder()); |
47 border->set_insets(views::LabelButtonAssetBorder::GetDefaultInsetsForStyle( | 47 border->set_insets(views::LabelButtonAssetBorder::GetDefaultInsetsForStyle( |
48 Button::STYLE_TEXTBUTTON)); | 48 Button::STYLE_TEXTBUTTON)); |
49 return border; | 49 return border; |
50 } | 50 } |
51 | 51 |
52 // static | 52 // static |
53 scoped_ptr<ScrollBar> PlatformStyle::CreateScrollBar(bool is_horizontal) { | 53 scoped_ptr<ScrollBar> PlatformStyle::CreateScrollBar(bool is_horizontal) { |
54 return make_scoped_ptr(new NativeScrollBar(is_horizontal)); | 54 return make_scoped_ptr(new NativeScrollBar(is_horizontal)); |
55 } | 55 } |
| 56 |
| 57 // static |
| 58 void PlatformStyle::ConfigureFocus(CONTROL control, View* view) { |
| 59 switch (control) { |
| 60 case CONTROL::BUTTON: |
| 61 case CONTROL::COMBOBOX: |
| 62 case CONTROL::LINK: |
| 63 case CONTROL::SLIDER: |
| 64 case CONTROL::TREE_VIEW: |
| 65 case CONTROL::TEXTFIELD: |
| 66 case CONTROL::TABLE_VIEW: |
| 67 case CONTROL::TABBED_PANE: |
| 68 case CONTROL::IN_MENU_BUTTON: |
| 69 case CONTROL::WEBVIEW: |
| 70 case CONTROL::ICON: |
| 71 case CONTROL::CREDENTIALS_ITEM_VIEW: |
| 72 case CONTROL::DESKTOP_MEDIA_LIST_VIEW: |
| 73 case CONTROL::DESKTOP_MEDIA_SOURCE_VIEW: |
| 74 view->SetFocusable(true); |
| 75 break; |
| 76 case CONTROL::SCROLLBAR_VIEW: |
| 77 case CONTROL::SEPARATOR: |
| 78 case CONTROL::COLOR_CHOOSER_VIEW: |
| 79 view->SetFocusable(false); |
| 80 view->SetAccessibilityFocusable(false); |
| 81 break; |
| 82 case CONTROL::TOOLBAR_BUTTON: |
| 83 view->SetFocusable(false); |
| 84 view->SetAccessibilityFocusable(true); |
| 85 break; |
| 86 } |
| 87 } |
| 88 |
56 #endif | 89 #endif |
57 | 90 |
58 #if !defined(OS_LINUX) || defined(OS_CHROMEOS) | 91 #if !defined(OS_LINUX) || defined(OS_CHROMEOS) |
59 // static | 92 // static |
60 scoped_ptr<Border> PlatformStyle::CreateThemedLabelButtonBorder( | 93 scoped_ptr<Border> PlatformStyle::CreateThemedLabelButtonBorder( |
61 LabelButton* button) { | 94 LabelButton* button) { |
62 return button->CreateDefaultBorder(); | 95 return button->CreateDefaultBorder(); |
63 } | 96 } |
64 #endif | 97 #endif |
65 | 98 |
66 } // namespace views | 99 } // namespace views |
OLD | NEW |