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

Side by Side Diff: chrome/browser/ui/gtk/status_bubble_gtk.cc

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 | 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/ui/gtk/status_bubble_gtk.h" 5 #include "chrome/browser/ui/gtk/status_bubble_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 padding_(NULL), 42 padding_(NULL),
43 flip_horizontally_(false), 43 flip_horizontally_(false),
44 y_offset_(0), 44 y_offset_(0),
45 download_shelf_is_visible_(false), 45 download_shelf_is_visible_(false),
46 last_mouse_location_(0, 0), 46 last_mouse_location_(0, 0),
47 last_mouse_left_content_(false), 47 last_mouse_left_content_(false),
48 ignore_next_left_content_(false) { 48 ignore_next_left_content_(false) {
49 InitWidgets(); 49 InitWidgets();
50 50
51 theme_service_->InitThemesFor(this); 51 theme_service_->InitThemesFor(this);
52 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, 52 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
53 Source<ThemeService>(theme_service_)); 53 Source<ThemeService>(theme_service_));
54 } 54 }
55 55
56 StatusBubbleGtk::~StatusBubbleGtk() { 56 StatusBubbleGtk::~StatusBubbleGtk() {
57 label_.Destroy(); 57 label_.Destroy();
58 container_.Destroy(); 58 container_.Destroy();
59 } 59 }
60 60
61 void StatusBubbleGtk::SetStatus(const string16& status_text_wide) { 61 void StatusBubbleGtk::SetStatus(const string16& status_text_wide) {
62 std::string status_text = UTF16ToUTF8(status_text_wide); 62 std::string status_text = UTF16ToUTF8(status_text_wide);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 } 227 }
228 228
229 if (y_offset_ != old_y_offset || flip_horizontally_ != old_flip_horizontally) 229 if (y_offset_ != old_y_offset || flip_horizontally_ != old_flip_horizontally)
230 gtk_widget_queue_resize_no_redraw(parent); 230 gtk_widget_queue_resize_no_redraw(parent);
231 } 231 }
232 232
233 void StatusBubbleGtk::UpdateDownloadShelfVisibility(bool visible) { 233 void StatusBubbleGtk::UpdateDownloadShelfVisibility(bool visible) {
234 download_shelf_is_visible_ = visible; 234 download_shelf_is_visible_ = visible;
235 } 235 }
236 236
237 void StatusBubbleGtk::Observe(NotificationType type, 237 void StatusBubbleGtk::Observe(int type,
238 const NotificationSource& source, 238 const NotificationSource& source,
239 const NotificationDetails& details) { 239 const NotificationDetails& details) {
240 if (type == NotificationType::BROWSER_THEME_CHANGED) { 240 if (type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED) {
241 UserChangedTheme(); 241 UserChangedTheme();
242 } 242 }
243 } 243 }
244 244
245 void StatusBubbleGtk::InitWidgets() { 245 void StatusBubbleGtk::InitWidgets() {
246 bool ltr = !base::i18n::IsRTL(); 246 bool ltr = !base::i18n::IsRTL();
247 247
248 label_.Own(gtk_label_new(NULL)); 248 label_.Own(gtk_label_new(NULL));
249 249
250 padding_ = gtk_alignment_new(0, 0, 1, 1); 250 padding_ = gtk_alignment_new(0, 0, 1, 1);
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 return FALSE; 357 return FALSE;
358 } 358 }
359 359
360 void StatusBubbleGtk::AnimationEnded(const ui::Animation* animation) { 360 void StatusBubbleGtk::AnimationEnded(const ui::Animation* animation) {
361 UpdateLabelSizeRequest(); 361 UpdateLabelSizeRequest();
362 } 362 }
363 363
364 void StatusBubbleGtk::AnimationProgressed(const ui::Animation* animation) { 364 void StatusBubbleGtk::AnimationProgressed(const ui::Animation* animation) {
365 UpdateLabelSizeRequest(); 365 UpdateLabelSizeRequest();
366 } 366 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698