Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(733)

Side by Side Diff: chrome/browser/ui/exclusive_access/exclusive_access_context_browser.cc

Issue 877413004: Refactor away the Browser* dependency in exclusive_access (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove Browser* dependency from ExclusiveAccess* in Cocoa. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/exclusive_access/exclusive_access_context_browser.h"
6
7 #include "chrome/browser/download/download_shelf.h"
8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_window.h"
10 #include "chrome/browser/ui/status_bubble.h"
11 #include "chrome/browser/ui/tabs/tab_strip_model.h"
12 #include "content/public/browser/web_contents.h"
13
14 using content::WebContents;
15
16 ExclusiveAccessContextBrowser::ExclusiveAccessContextBrowser(Browser* browser)
17 : browser_(browser) {
18 }
19
20 ExclusiveAccessContextBrowser::~ExclusiveAccessContextBrowser() {
21 }
22
23 Profile* ExclusiveAccessContextBrowser::GetProfile() {
24 return browser_->profile();
25 }
26
27 bool ExclusiveAccessContextBrowser::IsFullscreen() {
28 return browser_->window()->IsFullscreen();
29 }
30
31 bool ExclusiveAccessContextBrowser::IsFullscreenWithToolbar() {
32 return browser_->window()->IsFullscreenWithToolbar();
33 }
34
35 bool ExclusiveAccessContextBrowser::SupportsFullscreenWithToolbar() {
36 return browser_->window()->SupportsFullscreenWithToolbar();
37 }
38
39 void ExclusiveAccessContextBrowser::EnterFullscreen(
40 const GURL& url,
41 ExclusiveAccessBubbleType bubble_type,
42 bool with_toolbar) {
43 browser_->window()->EnterFullscreen(url, bubble_type, with_toolbar);
44 }
45
46 void ExclusiveAccessContextBrowser::ExitFullscreen() {
47 browser_->window()->ExitFullscreen();
48 }
49
50 void ExclusiveAccessContextBrowser::UpdateExclusiveAccessExitBubbleContent(
51 GURL url,
52 ExclusiveAccessBubbleType bubble_type) {
53 browser_->window()->UpdateFullscreenExitBubbleContent(url, bubble_type);
54 }
55
56 WebContents* ExclusiveAccessContextBrowser::GetActiveWebContents() {
57 return browser_->tab_strip_model()->GetActiveWebContents();
58 }
59
60 void ExclusiveAccessContextBrowser::UpdateFullscreenWithToolbar(
61 bool with_toolbar) {
62 return browser_->window()->UpdateFullscreenWithToolbar(with_toolbar);
63 }
64
65 void ExclusiveAccessContextBrowser::SetMetroSnapMode(bool enable) {
66 #if defined(OS_WIN)
67 browser_->window()->SetMetroSnapMode(enable);
68 #endif
69 }
70
71 bool ExclusiveAccessContextBrowser::IsInMetroSnapMode() {
72 #if defined(OS_WIN)
73 return browser_->window()->IsInMetroSnapMode();
74 #else
75 return false;
76 #endif
77 }
78
79 void ExclusiveAccessContextBrowser::UpdateDownloadShelf(bool unhide) {
80 BrowserWindow* const window = browser_->window();
81 if (unhide) {
82 window->GetDownloadShelf()->Unhide();
83 } else {
84 window->GetDownloadShelf()->Hide();
85 if (window->GetStatusBubble())
86 window->GetStatusBubble()->Hide();
87 }
88 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698