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/views/frame/opaque_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/prefs/pref_service.h" | 14 #include "chrome/browser/prefs/pref_service.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/profiles/profile_info_cache.h" | 16 #include "chrome/browser/profiles/profile_info_cache.h" |
17 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
18 #include "chrome/browser/themes/theme_service.h" | 18 #include "chrome/browser/themes/theme_service.h" |
19 #include "chrome/browser/ui/views/avatar_menu_button.h" | 19 #include "chrome/browser/ui/views/avatar_menu_button.h" |
20 #include "chrome/browser/ui/views/frame/browser_frame.h" | 20 #include "chrome/browser/ui/views/frame/browser_frame.h" |
21 #include "chrome/browser/ui/views/frame/browser_view.h" | 21 #include "chrome/browser/ui/views/frame/browser_view.h" |
22 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 22 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
23 #include "chrome/browser/ui/views/toolbar_view.h" | 23 #include "chrome/browser/ui/views/toolbar_view.h" |
24 #include "chrome/common/chrome_notification_types.h" | 24 #include "chrome/common/chrome_notification_types.h" |
25 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
26 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
27 #include "content/browser/tab_contents/tab_contents.h" | 27 #include "content/browser/tab_contents/tab_contents.h" |
28 #include "content/common/notification_service.h" | 28 #include "content/public/browser/notification_service.h" |
29 #include "grit/chromium_strings.h" | 29 #include "grit/chromium_strings.h" |
30 #include "grit/generated_resources.h" | 30 #include "grit/generated_resources.h" |
31 #include "grit/theme_resources.h" | 31 #include "grit/theme_resources.h" |
32 #include "grit/theme_resources_standard.h" | 32 #include "grit/theme_resources_standard.h" |
33 #include "grit/ui_resources.h" | 33 #include "grit/ui_resources.h" |
34 #include "ui/base/accessibility/accessible_view_state.h" | 34 #include "ui/base/accessibility/accessible_view_state.h" |
35 #include "ui/base/l10n/l10n_util.h" | 35 #include "ui/base/l10n/l10n_util.h" |
36 #include "ui/base/resource/resource_bundle.h" | 36 #include "ui/base/resource/resource_bundle.h" |
37 #include "ui/base/theme_provider.h" | 37 #include "ui/base/theme_provider.h" |
38 #include "ui/gfx/canvas_skia.h" | 38 #include "ui/gfx/canvas_skia.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 if (browser_view_->ShouldShowWindowIcon()) { | 199 if (browser_view_->ShouldShowWindowIcon()) { |
200 window_icon_ = new TabIconView(this); | 200 window_icon_ = new TabIconView(this); |
201 window_icon_->set_is_light(true); | 201 window_icon_->set_is_light(true); |
202 AddChildView(window_icon_); | 202 AddChildView(window_icon_); |
203 window_icon_->Update(); | 203 window_icon_->Update(); |
204 } | 204 } |
205 | 205 |
206 UpdateAvatarInfo(); | 206 UpdateAvatarInfo(); |
207 if (!browser_view_->IsOffTheRecord()) { | 207 if (!browser_view_->IsOffTheRecord()) { |
208 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, | 208 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, |
209 NotificationService::AllSources()); | 209 content::NotificationService::AllSources()); |
210 } | 210 } |
211 | 211 |
212 #if defined(USE_VIRTUAL_KEYBOARD) | 212 #if defined(USE_VIRTUAL_KEYBOARD) |
213 // Make sure the singleton VirtualKeyboardManager object is initialized. | 213 // Make sure the singleton VirtualKeyboardManager object is initialized. |
214 VirtualKeyboardManager::GetInstance(); | 214 VirtualKeyboardManager::GetInstance(); |
215 #endif | 215 #endif |
216 } | 216 } |
217 | 217 |
218 OpaqueBrowserFrameView::~OpaqueBrowserFrameView() { | 218 OpaqueBrowserFrameView::~OpaqueBrowserFrameView() { |
219 } | 219 } |
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 ProfileInfoCache& cache = | 1137 ProfileInfoCache& cache = |
1138 g_browser_process->profile_manager()->GetProfileInfoCache(); | 1138 g_browser_process->profile_manager()->GetProfileInfoCache(); |
1139 Profile* profile = browser_view_->browser()->profile(); | 1139 Profile* profile = browser_view_->browser()->profile(); |
1140 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); | 1140 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); |
1141 if (index != std::string::npos) { | 1141 if (index != std::string::npos) { |
1142 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); | 1142 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); |
1143 avatar_button_->SetText(cache.GetNameOfProfileAtIndex(index)); | 1143 avatar_button_->SetText(cache.GetNameOfProfileAtIndex(index)); |
1144 } | 1144 } |
1145 } | 1145 } |
1146 } | 1146 } |
OLD | NEW |