Home | History | Annotate | Download | only in extensions
      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
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/browser/extensions/gtk_theme_installed_infobar_delegate.h"
      6 
      7 #include "chrome/browser/themes/theme_service.h"
      8 
      9 GtkThemeInstalledInfoBarDelegate::GtkThemeInstalledInfoBarDelegate(
     10     TabContents* tab_contents,
     11     const Extension* new_theme,
     12     const std::string& previous_theme_id,
     13     bool previous_use_gtk_theme)
     14     : ThemeInstalledInfoBarDelegate(tab_contents, new_theme, previous_theme_id),
     15       previous_use_gtk_theme_(previous_use_gtk_theme) {
     16 }
     17 
     18 bool GtkThemeInstalledInfoBarDelegate::Cancel() {
     19   if (previous_use_gtk_theme_) {
     20     theme_service()->SetNativeTheme();
     21     return true;
     22   } else {
     23     return ThemeInstalledInfoBarDelegate::Cancel();
     24   }
     25 }
     26