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/views/chrome_browser_main_extra_parts_views.h" | 5 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" |
6 | 6 |
7 #include "chrome/browser/chrome_browser_main.h" | 7 #include "chrome/browser/chrome_browser_main.h" |
8 #include "chrome/browser/toolkit_extra_parts.h" | |
9 #include "chrome/browser/ui/views/chrome_views_delegate.h" | 8 #include "chrome/browser/ui/views/chrome_views_delegate.h" |
10 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
11 #include "ui/base/ui_base_switches.h" | 10 #include "ui/base/ui_base_switches.h" |
12 | 11 |
13 ChromeBrowserMainExtraPartsViews::ChromeBrowserMainExtraPartsViews() { | 12 ChromeBrowserMainExtraPartsViews::ChromeBrowserMainExtraPartsViews() { |
14 } | 13 } |
15 | 14 |
16 void ChromeBrowserMainExtraPartsViews::ToolkitInitialized() { | 15 void ChromeBrowserMainExtraPartsViews::ToolkitInitialized() { |
17 // The delegate needs to be set before any UI is created so that windows | 16 // The delegate needs to be set before any UI is created so that windows |
18 // display the correct icon. | 17 // display the correct icon. |
19 if (!views::ViewsDelegate::views_delegate) | 18 if (!views::ViewsDelegate::views_delegate) |
20 views::ViewsDelegate::views_delegate = new ChromeViewsDelegate; | 19 views::ViewsDelegate::views_delegate = new ChromeViewsDelegate; |
21 } | 20 } |
22 | |
23 namespace chrome { | |
24 | |
25 void AddViewsToolkitExtraParts(ChromeBrowserMainParts* main_parts) { | |
26 main_parts->AddParts(new ChromeBrowserMainExtraPartsViews()); | |
27 } | |
28 | |
29 } // namespace chrome | |
OLD | NEW |