| 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 "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // The cursor is not idle and either it's in the slide-in region or it's in | 150 // The cursor is not idle and either it's in the slide-in region or it's in |
| 151 // the neutral region and we're sliding in or out. | 151 // the neutral region and we're sliding in or out. |
| 152 Show(); | 152 Show(); |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 | 155 |
| 156 void ExclusiveAccessBubble::ExitExclusiveAccess() { | 156 void ExclusiveAccessBubble::ExitExclusiveAccess() { |
| 157 manager_->ExitExclusiveAccess(); | 157 manager_->ExitExclusiveAccess(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 void ExclusiveAccessBubble::Accept() { | |
| 161 manager_->OnAcceptExclusiveAccessPermission(); | |
| 162 } | |
| 163 | |
| 164 void ExclusiveAccessBubble::Cancel() { | |
| 165 manager_->OnDenyExclusiveAccessPermission(); | |
| 166 } | |
| 167 | |
| 168 base::string16 ExclusiveAccessBubble::GetCurrentMessageText() const { | 160 base::string16 ExclusiveAccessBubble::GetCurrentMessageText() const { |
| 169 return exclusive_access_bubble::GetLabelTextForType( | 161 return exclusive_access_bubble::GetLabelTextForType( |
| 170 bubble_type_, url_, | 162 bubble_type_, url_, |
| 171 extensions::ExtensionRegistry::Get(manager_->context()->GetProfile())); | 163 extensions::ExtensionRegistry::Get(manager_->context()->GetProfile())); |
| 172 } | 164 } |
| 173 | 165 |
| 174 base::string16 ExclusiveAccessBubble::GetCurrentDenyButtonText() const { | 166 base::string16 ExclusiveAccessBubble::GetCurrentDenyButtonText() const { |
| 175 return exclusive_access_bubble::GetDenyButtonTextForType(bubble_type_); | 167 return exclusive_access_bubble::GetDenyButtonTextForType(bubble_type_); |
| 176 } | 168 } |
| 177 | 169 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 191 // Do not allow the notification to hide for a few seconds. | 183 // Do not allow the notification to hide for a few seconds. |
| 192 hide_timeout_.Start(FROM_HERE, | 184 hide_timeout_.Start(FROM_HERE, |
| 193 base::TimeDelta::FromMilliseconds(kInitialDelayMs), this, | 185 base::TimeDelta::FromMilliseconds(kInitialDelayMs), this, |
| 194 &ExclusiveAccessBubble::CheckMousePosition); | 186 &ExclusiveAccessBubble::CheckMousePosition); |
| 195 | 187 |
| 196 // Do not show the notification again until a long time has elapsed. | 188 // Do not show the notification again until a long time has elapsed. |
| 197 suppress_notify_timeout_.Start( | 189 suppress_notify_timeout_.Start( |
| 198 FROM_HERE, base::TimeDelta::FromMilliseconds(kSnoozeNotificationsTimeMs), | 190 FROM_HERE, base::TimeDelta::FromMilliseconds(kSnoozeNotificationsTimeMs), |
| 199 this, &ExclusiveAccessBubble::CheckMousePosition); | 191 this, &ExclusiveAccessBubble::CheckMousePosition); |
| 200 } | 192 } |
| OLD | NEW |