diff options
author | mgiuca <mgiuca@chromium.org> | 2015-10-28 17:57:31 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-29 00:58:41 +0000 |
commit | 7de7140fee31af3b23cf445ffda771f820bd1708 (patch) | |
tree | 733adcbe294a5b9ff91d485890163b9e6af772e9 | |
parent | d95effdf36025ca669aca06823d6e61433da8c73 (diff) | |
download | chromium_src-7de7140fee31af3b23cf445ffda771f820bd1708.zip chromium_src-7de7140fee31af3b23cf445ffda771f820bd1708.tar.gz chromium_src-7de7140fee31af3b23cf445ffda771f820bd1708.tar.bz2 |
Minor refactor of ExclusiveAccessView (fullscreen info bubble).
- Reordered class fields so they have the same order as they are
inserted into the Views hierarchy.
- More detailed descriptions of views, including whether views are
present in simplified / non-simplified modes.
- Renamed mouse_lock_exit_instruction_ to exit_instruction_. (It also
shows exit instructions for fullscreen.)
BUG=352509
Review URL: https://codereview.chromium.org/1428673002
Cr-Commit-Position: refs/heads/master@{#356714}
-rw-r--r-- | chrome/browser/ui/views/exclusive_access_bubble_views.cc | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/chrome/browser/ui/views/exclusive_access_bubble_views.cc b/chrome/browser/ui/views/exclusive_access_bubble_views.cc index 6a8e0c3..3bebd07 100644 --- a/chrome/browser/ui/views/exclusive_access_bubble_views.cc +++ b/chrome/browser/ui/views/exclusive_access_bubble_views.cc @@ -113,13 +113,17 @@ class ExclusiveAccessBubbleViews::ExclusiveAccessView private: ExclusiveAccessBubbleViews* bubble_; - // Clickable hint text for exiting fullscreen mode. + // Clickable hint text for exiting fullscreen mode. (Non-simplified mode + // only.) views::Link* link_; - // Instruction for exiting mouse lock. - views::Label* mouse_lock_exit_instruction_; - // Informational label: 'www.foo.com has gone fullscreen'. + // Informational label: 'www.foo.com has gone fullscreen'. (Non-simplified + // mode only.) views::Label* message_label_; + // Clickable buttons to exit fullscreen. (Non-simplified mode only.) ButtonView* button_view_; + // Instruction for exiting fullscreen / mouse lock. Only present if there is + // no link or button (always present in simplified mode). + views::Label* exit_instruction_; const base::string16 browser_fullscreen_exit_accelerator_; DISALLOW_COPY_AND_ASSIGN(ExclusiveAccessView); @@ -132,9 +136,9 @@ ExclusiveAccessBubbleViews::ExclusiveAccessView::ExclusiveAccessView( ExclusiveAccessBubbleType bubble_type) : bubble_(bubble), link_(nullptr), - mouse_lock_exit_instruction_(nullptr), message_label_(nullptr), button_view_(nullptr), + exit_instruction_(nullptr), browser_fullscreen_exit_accelerator_(accelerator) { views::BubbleBorder::Shadow shadow_type = views::BubbleBorder::BIG_SHADOW; #if defined(OS_LINUX) @@ -172,12 +176,12 @@ ExclusiveAccessBubbleViews::ExclusiveAccessView::ExclusiveAccessView( message_label_->SetBackgroundColor(background_color); } - mouse_lock_exit_instruction_ = + exit_instruction_ = new views::Label(bubble_->GetInstructionText(), medium_font_list); - mouse_lock_exit_instruction_->set_collapse_when_hidden(true); + exit_instruction_->set_collapse_when_hidden(true); - mouse_lock_exit_instruction_->SetEnabledColor(foreground_color); - mouse_lock_exit_instruction_->SetBackgroundColor(background_color); + exit_instruction_->SetEnabledColor(foreground_color); + exit_instruction_->SetBackgroundColor(background_color); link_ = new views::Link(); link_->set_collapse_when_hidden(true); @@ -217,7 +221,7 @@ ExclusiveAccessBubbleViews::ExclusiveAccessView::ExclusiveAccessView( layout->AddView(message_label_); } layout->AddView(button_view_); - layout->AddView(mouse_lock_exit_instruction_); + layout->AddView(exit_instruction_); layout->AddView(link_); gfx::Insets padding(kPaddingPx, kPaddingPx, kPaddingPx, kPaddingPx); @@ -258,7 +262,7 @@ void ExclusiveAccessBubbleViews::ExclusiveAccessView::UpdateContent( if (exclusive_access_bubble::ShowButtonsForType(bubble_type)) { link_->SetVisible(false); - mouse_lock_exit_instruction_->SetVisible(false); + exit_instruction_->SetVisible(false); button_view_->SetVisible(true); button_view_->deny_button()->SetText(bubble_->GetCurrentDenyButtonText()); button_view_->deny_button()->SetMinSize(gfx::Size()); @@ -289,7 +293,7 @@ void ExclusiveAccessBubbleViews::ExclusiveAccessView::UpdateContent( } #endif link_->SetVisible(link_visible); - mouse_lock_exit_instruction_->SetVisible(!link_visible); + exit_instruction_->SetVisible(!link_visible); button_view_->SetVisible(false); } } |