OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/chromeos/status_area_view.h" | 5 #include "chrome/browser/chromeos/status_area_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/gfx/canvas.h" | 9 #include "app/gfx/canvas.h" |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
11 #include "app/theme_provider.h" | 11 #include "app/theme_provider.h" |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
13 #include "chrome/app/chrome_dll_resource.h" | 13 #include "chrome/app/chrome_dll_resource.h" |
14 #include "chrome/browser/browser.h" | 14 #include "chrome/browser/browser.h" |
15 #include "chrome/browser/browser_window.h" | 15 #include "chrome/browser/browser_window.h" |
16 #include "chrome/browser/chromeos/clock_menu_button.h" | 16 #include "chrome/browser/chromeos/clock_menu_button.h" |
17 #include "chrome/browser/chromeos/network_menu_button.h" | 17 #include "chrome/browser/chromeos/network_menu_button.h" |
18 #include "chrome/browser/chromeos/power_menu_button.h" | 18 #include "chrome/browser/chromeos/power_menu_button.h" |
19 #include "chrome/browser/chromeos/status_area_button.h" | 19 #include "chrome/browser/chromeos/status_area_button.h" |
20 #if !defined(TOOLKIT_VIEWS) | 20 #if !defined(TOOLKIT_VIEWS) |
21 #include "chrome/browser/gtk/browser_window_gtk.h" | 21 #include "chrome/browser/gtk/browser_window_gtk.h" |
22 #endif | 22 #endif |
23 #include "chrome/browser/profile.h" | 23 #include "chrome/browser/profile.h" |
24 #include "grit/chromium_strings.h" | 24 #include "grit/chromium_strings.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 "views/controls/menu/menu.h" | 27 #include "views/controls/menu/menu.h" |
28 #include "views/controls/menu/simple_menu_model.h" | 28 #include "views/controls/menu/simple_menu_model.h" |
29 | 29 |
30 namespace { | 30 namespace chromeos { |
31 | 31 |
32 // Number of pixels to pad on the left border. | 32 // Number of pixels to pad on the left border. |
33 const int kLeftBorder = 1; | 33 const int kLeftBorder = 1; |
34 // Number of pixels to separate the clock from the next item on the right. | 34 // Number of pixels to separate the clock from the next item on the right. |
35 const int kClockSeparation = 4; | 35 const int kClockSeparation = 4; |
36 | 36 |
37 // BrowserWindowGtk tiles its image with this offset | 37 // BrowserWindowGtk tiles its image with this offset |
38 const int kCustomFrameBackgroundVerticalOffset = 15; | 38 const int kCustomFrameBackgroundVerticalOffset = 15; |
39 | 39 |
40 class OptionsMenuModel : public views::SimpleMenuModel, | 40 class OptionsMenuModel : public views::SimpleMenuModel, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 NOTREACHED(); | 107 NOTREACHED(); |
108 } | 108 } |
109 } | 109 } |
110 | 110 |
111 private: | 111 private: |
112 Browser* browser_; | 112 Browser* browser_; |
113 | 113 |
114 DISALLOW_COPY_AND_ASSIGN(OptionsMenuModel); | 114 DISALLOW_COPY_AND_ASSIGN(OptionsMenuModel); |
115 }; | 115 }; |
116 | 116 |
117 } // namespace | |
118 | |
119 // Default to opening new tabs on the left. | 117 // Default to opening new tabs on the left. |
120 StatusAreaView::OpenTabsMode StatusAreaView::open_tabs_mode_ = | 118 StatusAreaView::OpenTabsMode StatusAreaView::open_tabs_mode_ = |
121 StatusAreaView::OPEN_TABS_ON_LEFT; | 119 StatusAreaView::OPEN_TABS_ON_LEFT; |
122 | 120 |
123 StatusAreaView::StatusAreaView(Browser* browser, | 121 StatusAreaView::StatusAreaView(Browser* browser, |
124 gfx::NativeWindow window) | 122 gfx::NativeWindow window) |
125 : browser_(browser), | 123 : browser_(browser), |
126 window_(window), | 124 window_(window), |
127 clock_view_(NULL), | 125 clock_view_(NULL), |
128 network_view_(NULL), | 126 network_view_(NULL), |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 } | 273 } |
276 | 274 |
277 void StatusAreaView::ExecuteCommand(int command_id) { | 275 void StatusAreaView::ExecuteCommand(int command_id) { |
278 browser_->ExecuteCommand(command_id); | 276 browser_->ExecuteCommand(command_id); |
279 } | 277 } |
280 | 278 |
281 void StatusAreaView::RunMenu(views::View* source, const gfx::Point& pt) { | 279 void StatusAreaView::RunMenu(views::View* source, const gfx::Point& pt) { |
282 CreateAppMenu(); | 280 CreateAppMenu(); |
283 app_menu_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT); | 281 app_menu_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT); |
284 } | 282 } |
| 283 |
| 284 } // namespace chromeos |
OLD | NEW |