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

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

Issue 1690543004: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/exclusive_access_bubble_views.h" 5 #include "chrome/browser/ui/views/exclusive_access_bubble_views.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 views::LabelButton* accept_button_; 67 views::LabelButton* accept_button_;
68 views::LabelButton* deny_button_; 68 views::LabelButton* deny_button_;
69 DISALLOW_COPY_AND_ASSIGN(ButtonView); 69 DISALLOW_COPY_AND_ASSIGN(ButtonView);
70 }; 70 };
71 71
72 ButtonView::ButtonView(views::ButtonListener* listener, 72 ButtonView::ButtonView(views::ButtonListener* listener,
73 int between_button_spacing) 73 int between_button_spacing)
74 : accept_button_(nullptr), deny_button_(nullptr) { 74 : accept_button_(nullptr), deny_button_(nullptr) {
75 accept_button_ = new views::LabelButton(listener, base::string16()); 75 accept_button_ = new views::LabelButton(listener, base::string16());
76 accept_button_->SetStyle(views::Button::STYLE_BUTTON); 76 accept_button_->SetStyle(views::Button::STYLE_BUTTON);
77 accept_button_->SetFocusable(false); 77 accept_button_->SetFocusBehavior(views::View::FocusBehavior::NEVER);
78 AddChildView(accept_button_); 78 AddChildView(accept_button_);
79 79
80 deny_button_ = new views::LabelButton(listener, base::string16()); 80 deny_button_ = new views::LabelButton(listener, base::string16());
81 deny_button_->SetStyle(views::Button::STYLE_BUTTON); 81 deny_button_->SetStyle(views::Button::STYLE_BUTTON);
82 deny_button_->SetFocusable(false); 82 deny_button_->SetFocusBehavior(views::View::FocusBehavior::NEVER);
83 AddChildView(deny_button_); 83 AddChildView(deny_button_);
84 84
85 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 85 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0,
86 between_button_spacing)); 86 between_button_spacing));
87 } 87 }
88 88
89 ButtonView::~ButtonView() { 89 ButtonView::~ButtonView() {
90 } 90 }
91 91
92 // Class containing the exit instruction text. Contains fancy styling on the 92 // Class containing the exit instruction text. Contains fancy styling on the
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 : theme->GetSystemColor(ui::NativeTheme::kColorId_BubbleBackground); 250 : theme->GetSystemColor(ui::NativeTheme::kColorId_BubbleBackground);
251 SkColor foreground_color = 251 SkColor foreground_color =
252 ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled() 252 ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()
253 ? SK_ColorWHITE 253 ? SK_ColorWHITE
254 : theme->GetSystemColor(ui::NativeTheme::kColorId_LabelEnabledColor); 254 : theme->GetSystemColor(ui::NativeTheme::kColorId_LabelEnabledColor);
255 255
256 std::unique_ptr<views::BubbleBorder> bubble_border(new views::BubbleBorder( 256 std::unique_ptr<views::BubbleBorder> bubble_border(new views::BubbleBorder(
257 views::BubbleBorder::NONE, shadow_type, background_color)); 257 views::BubbleBorder::NONE, shadow_type, background_color));
258 set_background(new views::BubbleBackground(bubble_border.get())); 258 set_background(new views::BubbleBackground(bubble_border.get()));
259 SetBorder(std::move(bubble_border)); 259 SetBorder(std::move(bubble_border));
260 SetFocusable(false); 260 SetFocusBehavior(views::View::FocusBehavior::NEVER);
261 261
262 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 262 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
263 const gfx::FontList& font_list = 263 const gfx::FontList& font_list =
264 rb.GetFontList(ui::ResourceBundle::MediumFont); 264 rb.GetFontList(ui::ResourceBundle::MediumFont);
265 265
266 if (!ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) { 266 if (!ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) {
267 message_label_ = new views::Label(base::string16(), font_list); 267 message_label_ = new views::Label(base::string16(), font_list);
268 message_label_->SetEnabledColor(foreground_color); 268 message_label_->SetEnabledColor(foreground_color);
269 message_label_->SetBackgroundColor(background_color); 269 message_label_->SetBackgroundColor(background_color);
270 } 270 }
271 271
272 exit_instruction_ = new InstructionView(base::string16(), font_list, 272 exit_instruction_ = new InstructionView(base::string16(), font_list,
273 foreground_color, background_color); 273 foreground_color, background_color);
274 274
275 link_ = new views::Link(); 275 link_ = new views::Link();
276 link_->SetFocusable(false); 276 link_->SetFocusBehavior(views::View::FocusBehavior::NEVER);
277 #if defined(OS_CHROMEOS) 277 #if defined(OS_CHROMEOS)
278 // On CrOS, the link text doesn't change, since it doesn't show the shortcut. 278 // On CrOS, the link text doesn't change, since it doesn't show the shortcut.
279 link_->SetText(l10n_util::GetStringUTF16(IDS_EXIT_FULLSCREEN_MODE)); 279 link_->SetText(l10n_util::GetStringUTF16(IDS_EXIT_FULLSCREEN_MODE));
280 #endif 280 #endif
281 link_->set_listener(this); 281 link_->set_listener(this);
282 link_->SetFontList(font_list); 282 link_->SetFontList(font_list);
283 link_->SetPressedColor(foreground_color); 283 link_->SetPressedColor(foreground_color);
284 link_->SetEnabledColor(foreground_color); 284 link_->SetEnabledColor(foreground_color);
285 link_->SetBackgroundColor(background_color); 285 link_->SetBackgroundColor(background_color);
286 link_->SetVisible(false); 286 link_->SetVisible(false);
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 const content::NotificationDetails& details) { 648 const content::NotificationDetails& details) {
649 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); 649 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type);
650 UpdateForImmersiveState(); 650 UpdateForImmersiveState();
651 } 651 }
652 652
653 void ExclusiveAccessBubbleViews::OnWidgetVisibilityChanged( 653 void ExclusiveAccessBubbleViews::OnWidgetVisibilityChanged(
654 views::Widget* widget, 654 views::Widget* widget,
655 bool visible) { 655 bool visible) {
656 UpdateMouseWatcher(); 656 UpdateMouseWatcher();
657 } 657 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698