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/fullscreen/fullscreen_controller.h" | 5 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/app_mode/app_mode_utils.h" | 10 #include "chrome/browser/app_mode/app_mode_utils.h" |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 if (tab && registrar_.IsEmpty()) { | 461 if (tab && registrar_.IsEmpty()) { |
462 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 462 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
463 content::Source<content::NavigationController>(&tab->GetController())); | 463 content::Source<content::NavigationController>(&tab->GetController())); |
464 } else if (!tab && !registrar_.IsEmpty()) { | 464 } else if (!tab && !registrar_.IsEmpty()) { |
465 registrar_.RemoveAll(); | 465 registrar_.RemoveAll(); |
466 } | 466 } |
467 } | 467 } |
468 | 468 |
469 void FullscreenController::PostFullscreenChangeNotification( | 469 void FullscreenController::PostFullscreenChangeNotification( |
470 bool is_fullscreen) { | 470 bool is_fullscreen) { |
471 MessageLoop::current()->PostTask(FROM_HERE, | 471 base::MessageLoop::current()->PostTask( |
| 472 FROM_HERE, |
472 base::Bind(&FullscreenController::NotifyFullscreenChange, | 473 base::Bind(&FullscreenController::NotifyFullscreenChange, |
473 ptr_factory_.GetWeakPtr(), is_fullscreen)); | 474 ptr_factory_.GetWeakPtr(), |
| 475 is_fullscreen)); |
474 } | 476 } |
475 | 477 |
476 void FullscreenController::NotifyFullscreenChange(bool is_fullscreen) { | 478 void FullscreenController::NotifyFullscreenChange(bool is_fullscreen) { |
477 content::NotificationService::current()->Notify( | 479 content::NotificationService::current()->Notify( |
478 chrome::NOTIFICATION_FULLSCREEN_CHANGED, | 480 chrome::NOTIFICATION_FULLSCREEN_CHANGED, |
479 content::Source<FullscreenController>(this), | 481 content::Source<FullscreenController>(this), |
480 content::Details<bool>(&is_fullscreen)); | 482 content::Details<bool>(&is_fullscreen)); |
481 } | 483 } |
482 | 484 |
483 void FullscreenController::NotifyTabOfExitIfNecessary() { | 485 void FullscreenController::NotifyTabOfExitIfNecessary() { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 | 641 |
640 ContentSetting | 642 ContentSetting |
641 FullscreenController::GetMouseLockSetting(const GURL& url) const { | 643 FullscreenController::GetMouseLockSetting(const GURL& url) const { |
642 if (url.SchemeIsFile()) | 644 if (url.SchemeIsFile()) |
643 return CONTENT_SETTING_ALLOW; | 645 return CONTENT_SETTING_ALLOW; |
644 | 646 |
645 HostContentSettingsMap* settings_map = profile_->GetHostContentSettingsMap(); | 647 HostContentSettingsMap* settings_map = profile_->GetHostContentSettingsMap(); |
646 return settings_map->GetContentSetting(url, url, | 648 return settings_map->GetContentSetting(url, url, |
647 CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string()); | 649 CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string()); |
648 } | 650 } |
OLD | NEW |