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/fullscreen_controller.h" | 5 #include "chrome/browser/ui/exclusive_access/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/location.h" | 9 #include "base/location.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 | 498 |
499 // If the permission was granted to the website with no embedder, it should | 499 // If the permission was granted to the website with no embedder, it should |
500 // always be allowed, even if embedded. | 500 // always be allowed, even if embedded. |
501 if (HostContentSettingsMapFactory::GetForProfile( | 501 if (HostContentSettingsMapFactory::GetForProfile( |
502 exclusive_access_manager()->context()->GetProfile()) | 502 exclusive_access_manager()->context()->GetProfile()) |
503 ->GetContentSetting(url, url, CONTENT_SETTINGS_TYPE_FULLSCREEN, | 503 ->GetContentSetting(url, url, CONTENT_SETTINGS_TYPE_FULLSCREEN, |
504 std::string()) == CONTENT_SETTING_ALLOW) { | 504 std::string()) == CONTENT_SETTING_ALLOW) { |
505 return CONTENT_SETTING_ALLOW; | 505 return CONTENT_SETTING_ALLOW; |
506 } | 506 } |
507 | 507 |
508 // See the comment above the call to |SetContentSetting()| for how the | 508 // See the comment above the call to |SetContentSettingDefaultScope()| for how |
| 509 // the |
509 // requesting and embedding origins interact with each other wrt permissions. | 510 // requesting and embedding origins interact with each other wrt permissions. |
510 return HostContentSettingsMapFactory::GetForProfile( | 511 return HostContentSettingsMapFactory::GetForProfile( |
511 exclusive_access_manager()->context()->GetProfile()) | 512 exclusive_access_manager()->context()->GetProfile()) |
512 ->GetContentSetting(url, GetEmbeddingOrigin(), | 513 ->GetContentSetting(url, GetEmbeddingOrigin(), |
513 CONTENT_SETTINGS_TYPE_FULLSCREEN, std::string()); | 514 CONTENT_SETTINGS_TYPE_FULLSCREEN, std::string()); |
514 } | 515 } |
515 | 516 |
516 bool FullscreenController::IsPrivilegedFullscreenForTab() const { | 517 bool FullscreenController::IsPrivilegedFullscreenForTab() const { |
517 const bool embedded_widget_present = | 518 const bool embedded_widget_present = |
518 exclusive_access_tab() && | 519 exclusive_access_tab() && |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 return fullscreened_origin_; | 567 return fullscreened_origin_; |
567 | 568 |
568 return exclusive_access_tab()->GetLastCommittedURL(); | 569 return exclusive_access_tab()->GetLastCommittedURL(); |
569 } | 570 } |
570 | 571 |
571 GURL FullscreenController::GetEmbeddingOrigin() const { | 572 GURL FullscreenController::GetEmbeddingOrigin() const { |
572 DCHECK(exclusive_access_tab()); | 573 DCHECK(exclusive_access_tab()); |
573 | 574 |
574 return exclusive_access_tab()->GetLastCommittedURL(); | 575 return exclusive_access_tab()->GetLastCommittedURL(); |
575 } | 576 } |
OLD | NEW |