OLD | NEW |
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 21 matching lines...) Expand all Loading... |
32 #include "core/page/Chrome.h" | 32 #include "core/page/Chrome.h" |
33 #include "core/frame/FrameHost.h" | 33 #include "core/frame/FrameHost.h" |
34 #include "core/frame/LocalFrame.h" | 34 #include "core/frame/LocalFrame.h" |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 BarProp::BarProp(LocalFrame* frame, Type type) | 38 BarProp::BarProp(LocalFrame* frame, Type type) |
39 : DOMWindowProperty(frame) | 39 : DOMWindowProperty(frame) |
40 , m_type(type) | 40 , m_type(type) |
41 { | 41 { |
42 ScriptWrappable::init(this); | |
43 } | 42 } |
44 | 43 |
45 bool BarProp::visible() const | 44 bool BarProp::visible() const |
46 { | 45 { |
47 if (!m_frame) | 46 if (!m_frame) |
48 return false; | 47 return false; |
49 FrameHost* host = m_frame->host(); | 48 FrameHost* host = m_frame->host(); |
50 if (!host) | 49 if (!host) |
51 return false; | 50 return false; |
52 | 51 |
53 switch (m_type) { | 52 switch (m_type) { |
54 case Locationbar: | 53 case Locationbar: |
55 case Personalbar: | 54 case Personalbar: |
56 case Toolbar: | 55 case Toolbar: |
57 return host->chrome().toolbarsVisible(); | 56 return host->chrome().toolbarsVisible(); |
58 case Menubar: | 57 case Menubar: |
59 return host->chrome().menubarVisible(); | 58 return host->chrome().menubarVisible(); |
60 case Scrollbars: | 59 case Scrollbars: |
61 return host->chrome().scrollbarsVisible(); | 60 return host->chrome().scrollbarsVisible(); |
62 case Statusbar: | 61 case Statusbar: |
63 return host->chrome().statusbarVisible(); | 62 return host->chrome().statusbarVisible(); |
64 } | 63 } |
65 | 64 |
66 ASSERT_NOT_REACHED(); | 65 ASSERT_NOT_REACHED(); |
67 return false; | 66 return false; |
68 } | 67 } |
69 | 68 |
70 } // namespace blink | 69 } // namespace blink |
OLD | NEW |