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

Side by Side Diff: chrome/browser/chromeos/login/message_bubble.cc

Issue 8493011: Merge 108537 - Align avatar bubble with edge of anchor control (Closed) Base URL: svn://svn.chromium.org/chrome/branches/912/src/
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/status/caps_lock_menu_button.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 (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/login/message_bubble.h" 5 #include "chrome/browser/chromeos/login/message_bubble.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 views::BubbleBorder::ArrowLocation arrow_location, 143 views::BubbleBorder::ArrowLocation arrow_location,
144 SkBitmap* image, 144 SkBitmap* image,
145 const std::wstring& text, 145 const std::wstring& text,
146 const std::vector<std::wstring>& links, 146 const std::vector<std::wstring>& links,
147 MessageBubbleDelegate* delegate) { 147 MessageBubbleDelegate* delegate) {
148 // The bubble will be destroyed when it is closed. 148 // The bubble will be destroyed when it is closed.
149 MessageBubble* bubble = new MessageBubble( 149 MessageBubble* bubble = new MessageBubble(
150 views::Widget::InitParams::TYPE_POPUP, parent, image, text, links, 150 views::Widget::InitParams::TYPE_POPUP, parent, image, text, links,
151 true, delegate); 151 true, delegate);
152 bubble->InitBubble(parent, position_relative_to, arrow_location, 152 bubble->InitBubble(parent, position_relative_to, arrow_location,
153 views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR,
153 bubble->text_->parent(), delegate); 154 bubble->text_->parent(), delegate);
154 return bubble; 155 return bubble;
155 } 156 }
156 157
157 // static 158 // static
158 MessageBubble* MessageBubble::ShowNoGrab( 159 MessageBubble* MessageBubble::ShowNoGrab(
159 views::Widget* parent, 160 views::Widget* parent,
160 const gfx::Rect& position_relative_to, 161 const gfx::Rect& position_relative_to,
161 views::BubbleBorder::ArrowLocation arrow_location, 162 views::BubbleBorder::ArrowLocation arrow_location,
162 SkBitmap* image, 163 SkBitmap* image,
163 const std::wstring& text, 164 const std::wstring& text,
164 const std::wstring& help, 165 const std::wstring& help,
165 MessageBubbleDelegate* delegate) { 166 MessageBubbleDelegate* delegate) {
166 std::vector<std::wstring> links; 167 std::vector<std::wstring> links;
167 if (!help.empty()) 168 if (!help.empty())
168 links.push_back(help); 169 links.push_back(help);
169 // The bubble will be destroyed when it is closed. 170 // The bubble will be destroyed when it is closed.
170 MessageBubble* bubble = new MessageBubble( 171 MessageBubble* bubble = new MessageBubble(
171 views::Widget::InitParams::TYPE_CONTROL, parent, image, text, links, 172 views::Widget::InitParams::TYPE_CONTROL, parent, image, text, links,
172 false, delegate); 173 false, delegate);
173 bubble->InitBubble(parent, position_relative_to, arrow_location, 174 bubble->InitBubble(parent, position_relative_to, arrow_location,
175 views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR,
174 bubble->text_->parent(), delegate); 176 bubble->text_->parent(), delegate);
175 return bubble; 177 return bubble;
176 } 178 }
177 179
178 #if !defined(TOUCH_UI) && defined(TOOLKIT_USES_GTK) 180 #if !defined(TOUCH_UI) && defined(TOOLKIT_USES_GTK)
179 // TODO(saintlou): Unclear if we need this for the !gtk case. 181 // TODO(saintlou): Unclear if we need this for the !gtk case.
180 void MessageBubble::OnActiveChanged() { 182 void MessageBubble::OnActiveChanged() {
181 if (parent_ && IsActive()) { 183 if (parent_ && IsActive()) {
182 // Show the parent. 184 // Show the parent.
183 gtk_window_present_with_time(parent_->GetNativeWindow(), 185 gtk_window_present_with_time(parent_->GetNativeWindow(),
(...skipping 15 matching lines...) Expand all
199 #if !defined(TOUCH_UI) && defined(TOOLKIT_USES_GTK) 201 #if !defined(TOUCH_UI) && defined(TOOLKIT_USES_GTK)
200 gboolean MessageBubble::OnButtonPress(GtkWidget* widget, 202 gboolean MessageBubble::OnButtonPress(GtkWidget* widget,
201 GdkEventButton* event) { 203 GdkEventButton* event) {
202 NativeWidgetGtk::OnButtonPress(widget, event); 204 NativeWidgetGtk::OnButtonPress(widget, event);
203 // Never propagate event to parent. 205 // Never propagate event to parent.
204 return true; 206 return true;
205 } 207 }
206 #endif 208 #endif
207 209
208 } // namespace chromeos 210 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/status/caps_lock_menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698