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

Side by Side Diff: chrome/browser/chromeos/status/status_area_bubble.cc

Issue 8833004: Remove BubbleDelegateView ctor color arg, add simple setter/getter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pass set_color SkColor arg by value. Created 9 years 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 | Annotate | Revision Log
OLDNEW
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/chromeos/status/status_area_bubble.h" 5 #include "chrome/browser/chromeos/status/status_area_bubble.h"
6 6
7 #include "chrome/browser/ui/views/window.h" 7 #include "chrome/browser/ui/views/window.h"
8 #include "ui/base/accessibility/accessible_view_state.h" 8 #include "ui/base/accessibility/accessible_view_state.h"
9 #include "ui/views/controls/label.h" 9 #include "ui/views/controls/label.h"
10 #include "ui/views/layout/box_layout.h" 10 #include "ui/views/layout/box_layout.h"
11 11
12 namespace { 12 namespace {
13 13
14 // TODO(msw): Get color from theme/window color.
15 const SkColor kColor = SK_ColorWHITE;
16
17 const size_t kCloseBubbleTimerInSec = 5; 14 const size_t kCloseBubbleTimerInSec = 5;
18 15
19 } // namespace 16 } // namespace
20 17
21 namespace chromeos { 18 namespace chromeos {
22 19
23 StatusAreaBubbleContentView::StatusAreaBubbleContentView( 20 StatusAreaBubbleContentView::StatusAreaBubbleContentView(
24 views::View* anchor_view, 21 views::View* anchor_view,
25 views::View* icon_view, 22 views::View* icon_view,
26 const string16& message) 23 const string16& message)
27 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT, kColor), 24 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT),
28 icon_view_(icon_view), 25 icon_view_(icon_view),
29 message_view_(new views::Label(message)) { 26 message_view_(new views::Label(message)) {
30 // Padding around status. 27 // Padding around status.
31 const int kPadX = 10, kPadY = 5; 28 const int kPadX = 10, kPadY = 5;
32 // Padding between image and text. 29 // Padding between image and text.
33 const int kTextPadX = 10; 30 const int kTextPadX = 10;
34 31
35 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, 32 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal,
36 kPadX, kPadY, kTextPadX)); 33 kPadX, kPadY, kTextPadX));
37 AddChildView(icon_view_); 34 AddChildView(icon_view_);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } 100 }
104 101
105 void StatusAreaBubbleController::HideBubble() { 102 void StatusAreaBubbleController::HideBubble() {
106 if (!IsBubbleShown()) 103 if (!IsBubbleShown())
107 return; 104 return;
108 timer_.Stop(); // no-op if it's not running. 105 timer_.Stop(); // no-op if it's not running.
109 bubble_->GetWidget()->Close(); 106 bubble_->GetWidget()->Close();
110 } 107 }
111 108
112 } // namespace chromeos 109 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/setting_level_bubble.cc ('k') | chrome/browser/speech/speech_input_bubble_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698