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

Side by Side Diff: chrome/browser/ui/libgtkui/native_theme_gtk3.cc

Issue 2771603003: Gtk3: Fallback on using Aura alert icon colors (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/libgtkui/native_theme_gtk3.h" 5 #include "chrome/browser/ui/libgtkui/native_theme_gtk3.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "chrome/browser/ui/libgtkui/chrome_gtk_frame.h" 9 #include "chrome/browser/ui/libgtkui/chrome_gtk_frame.h"
10 #include "chrome/browser/ui/libgtkui/chrome_gtk_menu_subclasses.h" 10 #include "chrome/browser/ui/libgtkui/chrome_gtk_menu_subclasses.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 347
348 // Throbber 348 // Throbber
349 // TODO(thomasanderson): Render GtkSpinner directly. 349 // TODO(thomasanderson): Render GtkSpinner directly.
350 case ui::NativeTheme::kColorId_ThrobberSpinningColor: 350 case ui::NativeTheme::kColorId_ThrobberSpinningColor:
351 case ui::NativeTheme::kColorId_ThrobberWaitingColor: 351 case ui::NativeTheme::kColorId_ThrobberWaitingColor:
352 return GetFgColor("GtkMenu#menu GtkSpinner#spinner"); 352 return GetFgColor("GtkMenu#menu GtkSpinner#spinner");
353 case ui::NativeTheme::kColorId_ThrobberLightColor: 353 case ui::NativeTheme::kColorId_ThrobberLightColor:
354 return GetFgColor("GtkMenu#menu GtkSpinner#spinner:disabled"); 354 return GetFgColor("GtkMenu#menu GtkSpinner#spinner:disabled");
355 355
356 // Alert icons 356 // Alert icons
357 // Fallback to the same colors as Aura.
357 case ui::NativeTheme::kColorId_AlertSeverityLow: 358 case ui::NativeTheme::kColorId_AlertSeverityLow:
358 return GetBgColor("GtkInfoBar#infobar.info");
359 case ui::NativeTheme::kColorId_AlertSeverityMedium: 359 case ui::NativeTheme::kColorId_AlertSeverityMedium:
360 return GetBgColor("GtkInfoBar#infobar.warning"); 360 case ui::NativeTheme::kColorId_AlertSeverityHigh: {
361 case ui::NativeTheme::kColorId_AlertSeverityHigh: 361 // Alert icons appear on the toolbar, so use the toolbar BG
362 return GetBgColor("GtkInfoBar#infobar.error"); 362 // color to determine if the dark Aura theme should be used.
363 ui::NativeTheme* fallback_theme =
364 color_utils::IsDark(GetBgColor("GtkToolbar#toolbar"))
365 ? ui::NativeTheme::GetInstanceForNativeUi()
366 : ui::NativeThemeDarkAura::instance();
367 return fallback_theme->GetSystemColor(color_id);
368 }
363 369
364 case ui::NativeTheme::kColorId_NumColors: 370 case ui::NativeTheme::kColorId_NumColors:
365 NOTREACHED(); 371 NOTREACHED();
366 break; 372 break;
367 } 373 }
368 return kInvalidColorIdColor; 374 return kInvalidColorIdColor;
369 } 375 }
370 376
371 void OnThemeChanged(GObject* obj, GParamSpec* param, NativeThemeGtk3* theme) { 377 void OnThemeChanged(GObject* obj, GParamSpec* param, NativeThemeGtk3* theme) {
372 theme->ResetColorCache(); 378 theme->ResetColorCache();
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 593
588 if (frame_top_area.incognito) { 594 if (frame_top_area.incognito) {
589 bitmap = SkBitmapOperations::CreateHSLShiftedBitmap( 595 bitmap = SkBitmapOperations::CreateHSLShiftedBitmap(
590 bitmap, kDefaultTintFrameIncognito); 596 bitmap, kDefaultTintFrameIncognito);
591 } 597 }
592 598
593 canvas->drawBitmap(bitmap, rect.x(), rect.y()); 599 canvas->drawBitmap(bitmap, rect.x(), rect.y());
594 } 600 }
595 601
596 } // namespace libgtkui 602 } // namespace libgtkui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698