| 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/exclusive_access/exclusive_access_bubble.h" | 5 #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/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" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 CanMouseTriggerSlideIn()) { | 108 CanMouseTriggerSlideIn()) { |
| 109 Show(); | 109 Show(); |
| 110 } else if (IsAnimating()) { | 110 } else if (IsAnimating()) { |
| 111 // The cursor is not idle and either it's in the slide-in region or it's in | 111 // The cursor is not idle and either it's in the slide-in region or it's in |
| 112 // the neutral region and we're sliding in or out. | 112 // the neutral region and we're sliding in or out. |
| 113 Show(); | 113 Show(); |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 void ExclusiveAccessBubble::ToggleFullscreen() { | 117 void ExclusiveAccessBubble::ToggleFullscreen() { |
| 118 browser_->fullscreen_controller() | 118 browser_->exclusive_access_manager() |
| 119 ->ExitTabOrBrowserFullscreenToPreviousState(); | 119 ->fullscreen_controller() |
| 120 ->ExitExclusiveAccessToPreviousState(); |
| 120 } | 121 } |
| 121 | 122 |
| 122 void ExclusiveAccessBubble::Accept() { | 123 void ExclusiveAccessBubble::Accept() { |
| 123 browser_->fullscreen_controller()->OnAcceptFullscreenPermission(); | 124 browser_->exclusive_access_manager()->OnAcceptExclusiveAccessPermission(); |
| 124 } | 125 } |
| 125 | 126 |
| 126 void ExclusiveAccessBubble::Cancel() { | 127 void ExclusiveAccessBubble::Cancel() { |
| 127 browser_->fullscreen_controller()->OnDenyFullscreenPermission(); | 128 browser_->exclusive_access_manager()->OnDenyExclusiveAccessPermission(); |
| 128 } | 129 } |
| 129 | 130 |
| 130 base::string16 ExclusiveAccessBubble::GetCurrentMessageText() const { | 131 base::string16 ExclusiveAccessBubble::GetCurrentMessageText() const { |
| 131 return exclusive_access_bubble::GetLabelTextForType( | 132 return exclusive_access_bubble::GetLabelTextForType( |
| 132 bubble_type_, url_, | 133 bubble_type_, url_, |
| 133 extensions::ExtensionRegistry::Get(browser_->profile())); | 134 extensions::ExtensionRegistry::Get(browser_->profile())); |
| 134 } | 135 } |
| 135 | 136 |
| 136 base::string16 ExclusiveAccessBubble::GetCurrentDenyButtonText() const { | 137 base::string16 ExclusiveAccessBubble::GetCurrentDenyButtonText() const { |
| 137 return exclusive_access_bubble::GetDenyButtonTextForType(bubble_type_); | 138 return exclusive_access_bubble::GetDenyButtonTextForType(bubble_type_); |
| 138 } | 139 } |
| 139 | 140 |
| 140 base::string16 ExclusiveAccessBubble::GetAllowButtonText() const { | 141 base::string16 ExclusiveAccessBubble::GetAllowButtonText() const { |
| 141 return l10n_util::GetStringUTF16(IDS_FULLSCREEN_ALLOW); | 142 return l10n_util::GetStringUTF16(IDS_FULLSCREEN_ALLOW); |
| 142 } | 143 } |
| 143 | 144 |
| 144 base::string16 ExclusiveAccessBubble::GetInstructionText() const { | 145 base::string16 ExclusiveAccessBubble::GetInstructionText() const { |
| 145 return l10n_util::GetStringFUTF16(IDS_FULLSCREEN_PRESS_ESC_TO_EXIT, | 146 return l10n_util::GetStringFUTF16(IDS_FULLSCREEN_PRESS_ESC_TO_EXIT, |
| 146 l10n_util::GetStringUTF16(IDS_APP_ESC_KEY)); | 147 l10n_util::GetStringUTF16(IDS_APP_ESC_KEY)); |
| 147 } | 148 } |
| OLD | NEW |