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

Side by Side Diff: third_party/WebKit/Source/core/frame/BarProp.cpp

Issue 2585143002: Introduce ContextObserver (Closed)
Patch Set: temp Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/core/frame/BarProp.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 17 matching lines...) Expand all
28 28
29 #include "core/frame/BarProp.h" 29 #include "core/frame/BarProp.h"
30 30
31 #include "core/frame/FrameHost.h" 31 #include "core/frame/FrameHost.h"
32 #include "core/frame/LocalFrame.h" 32 #include "core/frame/LocalFrame.h"
33 #include "core/page/ChromeClient.h" 33 #include "core/page/ChromeClient.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 BarProp::BarProp(LocalFrame* frame, Type type) 37 BarProp::BarProp(LocalFrame* frame, Type type)
38 : DOMWindowProperty(frame), m_type(type) {} 38 : ContextClient(frame), m_type(type) {}
39 39
40 DEFINE_TRACE(BarProp) { 40 DEFINE_TRACE(BarProp) {
41 DOMWindowProperty::trace(visitor); 41 ContextClient::trace(visitor);
42 } 42 }
43 43
44 bool BarProp::visible() const { 44 bool BarProp::visible() const {
45 if (!frame()) 45 if (!frame())
46 return false; 46 return false;
47 FrameHost* host = frame()->host(); 47 DCHECK(frame()->host());
48 if (!host)
49 return false;
50 48
51 switch (m_type) { 49 switch (m_type) {
52 case Locationbar: 50 case Locationbar:
53 case Personalbar: 51 case Personalbar:
54 case Toolbar: 52 case Toolbar:
55 return host->chromeClient().toolbarsVisible(); 53 return frame()->host()->chromeClient().toolbarsVisible();
56 case Menubar: 54 case Menubar:
57 return host->chromeClient().menubarVisible(); 55 return frame()->host()->chromeClient().menubarVisible();
58 case Scrollbars: 56 case Scrollbars:
59 return host->chromeClient().scrollbarsVisible(); 57 return frame()->host()->chromeClient().scrollbarsVisible();
60 case Statusbar: 58 case Statusbar:
61 return host->chromeClient().statusbarVisible(); 59 return frame()->host()->chromeClient().statusbarVisible();
62 } 60 }
63 61
64 NOTREACHED(); 62 NOTREACHED();
65 return false; 63 return false;
66 } 64 }
67 65
68 } // namespace blink 66 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/BarProp.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698