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/glass_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/profiles/profile_info_cache.h" | 14 #include "chrome/browser/profiles/profile_info_cache.h" |
15 #include "chrome/browser/profiles/profile_manager.h" | 15 #include "chrome/browser/profiles/profile_manager.h" |
16 #include "chrome/browser/themes/theme_service.h" | 16 #include "chrome/browser/themes/theme_service.h" |
17 #include "chrome/browser/ui/views/avatar_menu_button.h" | 17 #include "chrome/browser/ui/views/avatar_menu_button.h" |
18 #include "chrome/browser/ui/views/frame/browser_view.h" | 18 #include "chrome/browser/ui/views/frame/browser_view.h" |
19 #include "chrome/browser/ui/views/tabs/tab.h" | 19 #include "chrome/browser/ui/views/tabs/tab.h" |
20 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 20 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
21 #include "chrome/common/chrome_notification_types.h" | 21 #include "chrome/common/chrome_notification_types.h" |
22 #include "chrome/common/chrome_switches.h" | 22 #include "chrome/common/chrome_switches.h" |
23 #include "chrome/common/pref_names.h" | 23 #include "chrome/common/pref_names.h" |
24 #include "content/common/notification_service.h" | 24 #include "content/public/browser/notification_service.h" |
25 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
26 #include "grit/theme_resources.h" | 26 #include "grit/theme_resources.h" |
27 #include "grit/theme_resources_standard.h" | 27 #include "grit/theme_resources_standard.h" |
28 #include "grit/ui_resources.h" | 28 #include "grit/ui_resources.h" |
29 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
30 #include "ui/base/resource/resource_bundle.h" | 30 #include "ui/base/resource/resource_bundle.h" |
31 #include "ui/base/theme_provider.h" | 31 #include "ui/base/theme_provider.h" |
32 #include "ui/gfx/canvas_skia.h" | 32 #include "ui/gfx/canvas_skia.h" |
33 #include "ui/gfx/icon_util.h" | 33 #include "ui/gfx/icon_util.h" |
34 #include "ui/gfx/image/image.h" | 34 #include "ui/gfx/image/image.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 frame_(frame), | 77 frame_(frame), |
78 browser_view_(browser_view), | 78 browser_view_(browser_view), |
79 throbber_running_(false), | 79 throbber_running_(false), |
80 throbber_frame_(0) { | 80 throbber_frame_(0) { |
81 if (browser_view_->ShouldShowWindowIcon()) | 81 if (browser_view_->ShouldShowWindowIcon()) |
82 InitThrobberIcons(); | 82 InitThrobberIcons(); |
83 | 83 |
84 UpdateAvatarInfo(); | 84 UpdateAvatarInfo(); |
85 if (!browser_view_->IsOffTheRecord()) { | 85 if (!browser_view_->IsOffTheRecord()) { |
86 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, | 86 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, |
87 NotificationService::AllSources()); | 87 content::NotificationService::AllSources()); |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 GlassBrowserFrameView::~GlassBrowserFrameView() { | 91 GlassBrowserFrameView::~GlassBrowserFrameView() { |
92 } | 92 } |
93 | 93 |
94 /////////////////////////////////////////////////////////////////////////////// | 94 /////////////////////////////////////////////////////////////////////////////// |
95 // GlassBrowserFrameView, BrowserNonClientFrameView implementation: | 95 // GlassBrowserFrameView, BrowserNonClientFrameView implementation: |
96 | 96 |
97 gfx::Rect GlassBrowserFrameView::GetBoundsForTabStrip( | 97 gfx::Rect GlassBrowserFrameView::GetBoundsForTabStrip( |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 ProfileInfoCache& cache = | 525 ProfileInfoCache& cache = |
526 g_browser_process->profile_manager()->GetProfileInfoCache(); | 526 g_browser_process->profile_manager()->GetProfileInfoCache(); |
527 Profile* profile = browser_view_->browser()->profile(); | 527 Profile* profile = browser_view_->browser()->profile(); |
528 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); | 528 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); |
529 if (index != std::string::npos) { | 529 if (index != std::string::npos) { |
530 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); | 530 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); |
531 avatar_button_->SetText(cache.GetNameOfProfileAtIndex(index)); | 531 avatar_button_->SetText(cache.GetNameOfProfileAtIndex(index)); |
532 } | 532 } |
533 } | 533 } |
534 } | 534 } |
OLD | NEW |