OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/webui/chrome_web_ui.h" | 5 #include "chrome/browser/ui/webui/chrome_web_ui.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 #include "content/browser/tab_contents/tab_contents.h" | 10 #include "content/browser/tab_contents/tab_contents.h" |
11 | 11 |
12 #if defined(TOOLKIT_VIEWS) | 12 #if defined(TOOLKIT_VIEWS) |
13 #include "views/widget/widget.h" | 13 #include "views/widget/widget.h" |
14 #endif | 14 #endif |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 // If true, overrides IsMoreWebUI flag. | 18 // If true, overrides IsMoreWebUI flag. |
19 bool override_more_webui_ = false; | 19 bool override_more_webui_ = false; |
20 | 20 |
21 } // namespace | 21 } // namespace |
22 | 22 |
23 ChromeWebUI::ChromeWebUI(TabContents* contents) | 23 ChromeWebUI::ChromeWebUI(TabContents* contents) |
24 : WebUI(contents), | 24 : WebUI(contents) { |
25 force_bookmark_bar_visible_(false) { | |
26 } | 25 } |
27 | 26 |
28 ChromeWebUI::~ChromeWebUI() { | 27 ChromeWebUI::~ChromeWebUI() { |
29 } | 28 } |
30 | 29 |
31 Profile* ChromeWebUI::GetProfile() const { | 30 Profile* ChromeWebUI::GetProfile() const { |
32 return Profile::FromBrowserContext(tab_contents()->browser_context()); | 31 return Profile::FromBrowserContext(tab_contents()->browser_context()); |
33 } | 32 } |
34 | 33 |
| 34 bool ChromeWebUI::CanShowBookmarkBar() const { |
| 35 return false; |
| 36 } |
| 37 |
35 // static | 38 // static |
36 bool ChromeWebUI::IsMoreWebUI() { | 39 bool ChromeWebUI::IsMoreWebUI() { |
37 bool more_webui = CommandLine::ForCurrentProcess()->HasSwitch( | 40 bool more_webui = CommandLine::ForCurrentProcess()->HasSwitch( |
38 switches::kUseMoreWebUI) || override_more_webui_; | 41 switches::kUseMoreWebUI) || override_more_webui_; |
39 #if defined(TOOLKIT_VIEWS) | 42 #if defined(TOOLKIT_VIEWS) |
40 more_webui |= views::Widget::IsPureViews(); | 43 more_webui |= views::Widget::IsPureViews(); |
41 #endif | 44 #endif |
42 return more_webui; | 45 return more_webui; |
43 } | 46 } |
44 | 47 |
45 void ChromeWebUI::OverrideMoreWebUI(bool use_more_webui) { | 48 void ChromeWebUI::OverrideMoreWebUI(bool use_more_webui) { |
46 override_more_webui_ = use_more_webui; | 49 override_more_webui_ = use_more_webui; |
47 } | 50 } |
OLD | NEW |