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" |
(...skipping 30 matching lines...) Expand all Loading... | |
41 #include "ui/gfx/path.h" | 41 #include "ui/gfx/path.h" |
42 #include "views/controls/button/image_button.h" | 42 #include "views/controls/button/image_button.h" |
43 #include "views/controls/image_view.h" | 43 #include "views/controls/image_view.h" |
44 #include "views/widget/root_view.h" | 44 #include "views/widget/root_view.h" |
45 #include "views/window/window_shape.h" | 45 #include "views/window/window_shape.h" |
46 | 46 |
47 #if defined(USE_VIRTUAL_KEYBOARD) | 47 #if defined(USE_VIRTUAL_KEYBOARD) |
48 #include "chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.h" | 48 #include "chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.h" |
49 #endif | 49 #endif |
50 | 50 |
51 #if defined(TOUCH_UI) | |
52 #include "chrome/browser/ui/touch/sensors/screen_orientation_listener.h" | |
53 #endif | |
54 | |
51 #if !defined(OS_WIN) | 55 #if !defined(OS_WIN) |
52 #include "views/window/hit_test.h" | 56 #include "views/window/hit_test.h" |
53 #endif | 57 #endif |
54 | 58 |
55 namespace { | 59 namespace { |
56 // The frame border is only visible in restored mode and is hardcoded to 4 px on | 60 // The frame border is only visible in restored mode and is hardcoded to 4 px on |
57 // each side regardless of the system window border size. | 61 // each side regardless of the system window border size. |
58 const int kFrameBorderThickness = 4; | 62 const int kFrameBorderThickness = 4; |
59 // Besides the frame border, there's another 11 px of empty space atop the | 63 // Besides the frame border, there's another 11 px of empty space atop the |
60 // window in restored mode, to use to drag the window around. | 64 // window in restored mode, to use to drag the window around. |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
212 UpdateAvatarInfo(); | 216 UpdateAvatarInfo(); |
213 if (!browser_view_->IsOffTheRecord()) { | 217 if (!browser_view_->IsOffTheRecord()) { |
214 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, | 218 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, |
215 content::NotificationService::AllSources()); | 219 content::NotificationService::AllSources()); |
216 } | 220 } |
217 | 221 |
218 #if defined(USE_VIRTUAL_KEYBOARD) | 222 #if defined(USE_VIRTUAL_KEYBOARD) |
219 // Make sure the singleton VirtualKeyboardManager object is initialized. | 223 // Make sure the singleton VirtualKeyboardManager object is initialized. |
220 VirtualKeyboardManager::GetInstance(); | 224 VirtualKeyboardManager::GetInstance(); |
221 #endif | 225 #endif |
226 | |
227 #if defined(TOUCH_UI) | |
228 // Make sure the singleton ScreenOrientationListener object is initialized. | |
229 ScreenOrientationListener::GetInstance(); | |
sky
2011/11/03 22:34:05
Could this (and the keyboard) be triggered from ch
| |
230 #endif | |
222 } | 231 } |
223 | 232 |
224 OpaqueBrowserFrameView::~OpaqueBrowserFrameView() { | 233 OpaqueBrowserFrameView::~OpaqueBrowserFrameView() { |
225 } | 234 } |
226 | 235 |
227 /////////////////////////////////////////////////////////////////////////////// | 236 /////////////////////////////////////////////////////////////////////////////// |
228 // OpaqueBrowserFrameView, protected: | 237 // OpaqueBrowserFrameView, protected: |
229 | 238 |
230 int OpaqueBrowserFrameView::GetReservedHeight() const { | 239 int OpaqueBrowserFrameView::GetReservedHeight() const { |
231 return 0; | 240 return 0; |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1180 ProfileInfoCache& cache = | 1189 ProfileInfoCache& cache = |
1181 g_browser_process->profile_manager()->GetProfileInfoCache(); | 1190 g_browser_process->profile_manager()->GetProfileInfoCache(); |
1182 Profile* profile = browser_view_->browser()->profile(); | 1191 Profile* profile = browser_view_->browser()->profile(); |
1183 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); | 1192 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); |
1184 if (index != std::string::npos) { | 1193 if (index != std::string::npos) { |
1185 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); | 1194 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); |
1186 avatar_button_->SetText(cache.GetNameOfProfileAtIndex(index)); | 1195 avatar_button_->SetText(cache.GetNameOfProfileAtIndex(index)); |
1187 } | 1196 } |
1188 } | 1197 } |
1189 } | 1198 } |
OLD | NEW |