OLD | NEW |
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 "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 link_->SetFontList(medium_font_list); | 159 link_->SetFontList(medium_font_list); |
160 link_->SetPressedColor(message_label_->enabled_color()); | 160 link_->SetPressedColor(message_label_->enabled_color()); |
161 link_->SetEnabledColor(message_label_->enabled_color()); | 161 link_->SetEnabledColor(message_label_->enabled_color()); |
162 link_->SetVisible(false); | 162 link_->SetVisible(false); |
163 | 163 |
164 link_->SetBackgroundColor(background()->get_color()); | 164 link_->SetBackgroundColor(background()->get_color()); |
165 message_label_->SetBackgroundColor(background()->get_color()); | 165 message_label_->SetBackgroundColor(background()->get_color()); |
166 mouse_lock_exit_instruction_->SetBackgroundColor(background()->get_color()); | 166 mouse_lock_exit_instruction_->SetBackgroundColor(background()->get_color()); |
167 | 167 |
168 button_view_ = new ButtonView(this, kPaddingPx); | 168 button_view_ = new ButtonView(this, kPaddingPx); |
169 button_view_->accept_button()->SetText(bubble->GetAllowButtonText()); | |
170 | 169 |
171 views::GridLayout* layout = new views::GridLayout(this); | 170 views::GridLayout* layout = new views::GridLayout(this); |
172 views::ColumnSet* columns = layout->AddColumnSet(0); | 171 views::ColumnSet* columns = layout->AddColumnSet(0); |
173 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 0, | 172 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 0, |
174 views::GridLayout::USE_PREF, 0, 0); | 173 views::GridLayout::USE_PREF, 0, 0); |
175 columns->AddPaddingColumn(1, kMiddlePaddingPx); | 174 columns->AddPaddingColumn(1, kMiddlePaddingPx); |
176 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 0, | 175 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 0, |
177 views::GridLayout::USE_PREF, 0, 0); | 176 views::GridLayout::USE_PREF, 0, 0); |
178 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 0, | 177 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 0, |
179 views::GridLayout::USE_PREF, 0, 0); | 178 views::GridLayout::USE_PREF, 0, 0); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 ExclusiveAccessBubbleType bubble_type) { | 216 ExclusiveAccessBubbleType bubble_type) { |
218 DCHECK_NE(EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE, bubble_type); | 217 DCHECK_NE(EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE, bubble_type); |
219 | 218 |
220 message_label_->SetText(bubble_->GetCurrentMessageText()); | 219 message_label_->SetText(bubble_->GetCurrentMessageText()); |
221 if (exclusive_access_bubble::ShowButtonsForType(bubble_type)) { | 220 if (exclusive_access_bubble::ShowButtonsForType(bubble_type)) { |
222 link_->SetVisible(false); | 221 link_->SetVisible(false); |
223 mouse_lock_exit_instruction_->SetVisible(false); | 222 mouse_lock_exit_instruction_->SetVisible(false); |
224 button_view_->SetVisible(true); | 223 button_view_->SetVisible(true); |
225 button_view_->deny_button()->SetText(bubble_->GetCurrentDenyButtonText()); | 224 button_view_->deny_button()->SetText(bubble_->GetCurrentDenyButtonText()); |
226 button_view_->deny_button()->SetMinSize(gfx::Size()); | 225 button_view_->deny_button()->SetMinSize(gfx::Size()); |
| 226 button_view_->accept_button()->SetText( |
| 227 bubble_->GetCurrentAllowButtonText()); |
| 228 button_view_->accept_button()->SetMinSize(gfx::Size()); |
227 } else { | 229 } else { |
228 bool link_visible = true; | 230 bool link_visible = true; |
229 base::string16 accelerator; | 231 base::string16 accelerator; |
230 if (bubble_type == | 232 if (bubble_type == |
231 EXCLUSIVE_ACCESS_BUBBLE_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION || | 233 EXCLUSIVE_ACCESS_BUBBLE_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION || |
232 bubble_type == | 234 bubble_type == |
233 EXCLUSIVE_ACCESS_BUBBLE_TYPE_EXTENSION_FULLSCREEN_EXIT_INSTRUCTION)
{ | 235 EXCLUSIVE_ACCESS_BUBBLE_TYPE_EXTENSION_FULLSCREEN_EXIT_INSTRUCTION)
{ |
234 accelerator = browser_fullscreen_exit_accelerator_; | 236 accelerator = browser_fullscreen_exit_accelerator_; |
235 } else if (bubble_type == | 237 } else if (bubble_type == |
236 EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_EXIT_INSTRUCTION) { | 238 EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_EXIT_INSTRUCTION) { |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 const content::NotificationDetails& details) { | 510 const content::NotificationDetails& details) { |
509 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); | 511 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); |
510 UpdateForImmersiveState(); | 512 UpdateForImmersiveState(); |
511 } | 513 } |
512 | 514 |
513 void ExclusiveAccessBubbleViews::OnWidgetVisibilityChanged( | 515 void ExclusiveAccessBubbleViews::OnWidgetVisibilityChanged( |
514 views::Widget* widget, | 516 views::Widget* widget, |
515 bool visible) { | 517 bool visible) { |
516 UpdateMouseWatcher(); | 518 UpdateMouseWatcher(); |
517 } | 519 } |
OLD | NEW |