| 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/fullscreen_exit_bubble.h" | 5 #include "chrome/browser/ui/fullscreen_exit_bubble.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/browser/ui/browser_commands.h" |
| 11 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" |
| 12 #include "grit/ui_strings.h" | 13 #include "grit/ui_strings.h" |
| 13 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
| 14 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
| 15 | 16 |
| 16 // NOTE(koz): Linux doesn't use the thick shadowed border, so we add padding | 17 // NOTE(koz): Linux doesn't use the thick shadowed border, so we add padding |
| 17 // here. | 18 // here. |
| 18 #ifdef LINUX | 19 #ifdef LINUX |
| 19 const int FullscreenExitBubble::kPaddingPx = 8; | 20 const int FullscreenExitBubble::kPaddingPx = 8; |
| 20 #else | 21 #else |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 } | 102 } |
| 102 } else if ((cursor_pos.y() < kSlideInRegionHeightPx) || | 103 } else if ((cursor_pos.y() < kSlideInRegionHeightPx) || |
| 103 IsAnimating()) { | 104 IsAnimating()) { |
| 104 // The cursor is not idle, and either it's in the slide-in region or it's in | 105 // The cursor is not idle, and either it's in the slide-in region or it's in |
| 105 // the neutral region and we're sliding out. | 106 // the neutral region and we're sliding out. |
| 106 Show(); | 107 Show(); |
| 107 } | 108 } |
| 108 } | 109 } |
| 109 | 110 |
| 110 void FullscreenExitBubble::ToggleFullscreen() { | 111 void FullscreenExitBubble::ToggleFullscreen() { |
| 111 browser_->ExecuteCommand(IDC_FULLSCREEN); | 112 chrome::ExecuteCommand(browser_, IDC_FULLSCREEN); |
| 112 } | 113 } |
| 113 | 114 |
| 114 void FullscreenExitBubble::Accept() { | 115 void FullscreenExitBubble::Accept() { |
| 115 browser_->OnAcceptFullscreenPermission(url_, bubble_type_); | 116 browser_->OnAcceptFullscreenPermission(url_, bubble_type_); |
| 116 } | 117 } |
| 117 | 118 |
| 118 void FullscreenExitBubble::Cancel() { | 119 void FullscreenExitBubble::Cancel() { |
| 119 browser_->OnDenyFullscreenPermission(bubble_type_); | 120 browser_->OnDenyFullscreenPermission(bubble_type_); |
| 120 } | 121 } |
| 121 | 122 |
| 122 string16 FullscreenExitBubble::GetCurrentMessageText() const { | 123 string16 FullscreenExitBubble::GetCurrentMessageText() const { |
| 123 return fullscreen_bubble::GetLabelTextForType( | 124 return fullscreen_bubble::GetLabelTextForType( |
| 124 bubble_type_, url_, browser_->profile()->GetExtensionService()); | 125 bubble_type_, url_, browser_->profile()->GetExtensionService()); |
| 125 } | 126 } |
| 126 | 127 |
| 127 string16 FullscreenExitBubble::GetCurrentDenyButtonText() const { | 128 string16 FullscreenExitBubble::GetCurrentDenyButtonText() const { |
| 128 return fullscreen_bubble::GetDenyButtonTextForType(bubble_type_); | 129 return fullscreen_bubble::GetDenyButtonTextForType(bubble_type_); |
| 129 } | 130 } |
| 130 | 131 |
| 131 string16 FullscreenExitBubble::GetAllowButtonText() const { | 132 string16 FullscreenExitBubble::GetAllowButtonText() const { |
| 132 return l10n_util::GetStringUTF16(IDS_FULLSCREEN_ALLOW); | 133 return l10n_util::GetStringUTF16(IDS_FULLSCREEN_ALLOW); |
| 133 } | 134 } |
| 134 | 135 |
| 135 string16 FullscreenExitBubble::GetInstructionText() const { | 136 string16 FullscreenExitBubble::GetInstructionText() const { |
| 136 return l10n_util::GetStringFUTF16(IDS_FULLSCREEN_PRESS_ESC_TO_EXIT, | 137 return l10n_util::GetStringFUTF16(IDS_FULLSCREEN_PRESS_ESC_TO_EXIT, |
| 137 l10n_util::GetStringUTF16(IDS_APP_ESC_KEY)); | 138 l10n_util::GetStringUTF16(IDS_APP_ESC_KEY)); |
| 138 } | 139 } |
| OLD | NEW |