Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Side by Side Diff: athena/system/status_icon_container_view.cc

Issue 662763002: Support modal windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: fix leaks Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « athena/system/status_icon_container_view.h ('k') | athena/system/system_ui_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "athena/system/status_icon_container_view.h" 5 #include "athena/system/status_icon_container_view.h"
6 6
7 #include "athena/resources/athena_resources.h" 7 #include "athena/resources/athena_resources.h"
8 #include "athena/system/network_selector.h" 8 #include "athena/system/network_selector.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 } 201 }
202 202
203 private: 203 private:
204 SystemUI::ColorScheme color_scheme_; 204 SystemUI::ColorScheme color_scheme_;
205 views::ImageView* icon_; 205 views::ImageView* icon_;
206 206
207 DISALLOW_COPY_AND_ASSIGN(UpdateStatus); 207 DISALLOW_COPY_AND_ASSIGN(UpdateStatus);
208 }; 208 };
209 209
210 StatusIconContainerView::StatusIconContainerView( 210 StatusIconContainerView::StatusIconContainerView(
211 SystemUI::ColorScheme color_scheme, 211 SystemUI::ColorScheme color_scheme) {
212 aura::Window* system_modal_container)
213 : system_modal_container_(system_modal_container) {
214 const int kHorizontalSpacing = 10; 212 const int kHorizontalSpacing = 10;
215 const int kVerticalSpacing = 3; 213 const int kVerticalSpacing = 3;
216 const int kBetweenChildSpacing = 10; 214 const int kBetweenChildSpacing = 10;
217 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, 215 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal,
218 kHorizontalSpacing, 216 kHorizontalSpacing,
219 kVerticalSpacing, 217 kVerticalSpacing,
220 kBetweenChildSpacing)); 218 kBetweenChildSpacing));
221 219
222 std::string version_text = 220 std::string version_text =
223 base::StringPrintf("%s (Build %s)", PRODUCT_VERSION, LAST_CHANGE); 221 base::StringPrintf("%s (Build %s)", PRODUCT_VERSION, LAST_CHANGE);
(...skipping 10 matching lines...) Expand all
234 232
235 views::ImageView* update_view = new views::ImageView(); 233 views::ImageView* update_view = new views::ImageView();
236 AddChildView(update_view); 234 AddChildView(update_view);
237 update_status_.reset(new UpdateStatus(color_scheme, update_view)); 235 update_status_.reset(new UpdateStatus(color_scheme, update_view));
238 } 236 }
239 237
240 StatusIconContainerView::~StatusIconContainerView() { 238 StatusIconContainerView::~StatusIconContainerView() {
241 } 239 }
242 240
243 bool StatusIconContainerView::OnMousePressed(const ui::MouseEvent& event) { 241 bool StatusIconContainerView::OnMousePressed(const ui::MouseEvent& event) {
244 CreateNetworkSelector(system_modal_container_); 242 CreateNetworkSelector();
245 return true; 243 return true;
246 } 244 }
247 245
248 void StatusIconContainerView::OnGestureEvent(ui::GestureEvent* event) { 246 void StatusIconContainerView::OnGestureEvent(ui::GestureEvent* event) {
249 if (event->type() == ui::ET_GESTURE_TAP) { 247 if (event->type() == ui::ET_GESTURE_TAP) {
250 CreateNetworkSelector(system_modal_container_); 248 CreateNetworkSelector();
251 event->SetHandled(); 249 event->SetHandled();
252 } 250 }
253 } 251 }
254 252
255 void StatusIconContainerView::ChildPreferredSizeChanged(views::View* child) { 253 void StatusIconContainerView::ChildPreferredSizeChanged(views::View* child) {
256 PreferredSizeChanged(); 254 PreferredSizeChanged();
257 } 255 }
258 256
259 } // namespace athena 257 } // namespace athena
OLDNEW
« no previous file with comments | « athena/system/status_icon_container_view.h ('k') | athena/system/system_ui_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698