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

Unified Diff: chrome/browser/ui/chrome_select_file_policy.cc

Issue 10698053: Breaks compile on Linux Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/chrome_select_file_policy.cc
===================================================================
--- chrome/browser/ui/chrome_select_file_policy.cc (revision 144942)
+++ chrome/browser/ui/chrome_select_file_policy.cc (working copy)
@@ -1,54 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/chrome_select_file_policy.h"
-
-#include "base/bind.h"
-#include "base/callback.h"
-#include "base/logging.h"
-#include "chrome/browser/browser_process.h"
-#include "chrome/browser/infobars/infobar_tab_helper.h"
-#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/tab_contents/simple_alert_infobar_delegate.h"
-#include "chrome/browser/ui/tab_contents/tab_contents.h"
-#include "chrome/common/pref_names.h"
-#include "grit/generated_resources.h"
-#include "ui/base/l10n/l10n_util.h"
-
-ChromeSelectFilePolicy::ChromeSelectFilePolicy(
- content::WebContents* source_contents)
- : source_contents_(source_contents) {
-}
-
-ChromeSelectFilePolicy::~ChromeSelectFilePolicy() {}
-
-bool ChromeSelectFilePolicy::CanOpenSelectFileDialog() {
- DCHECK(g_browser_process);
-
- // local_state() can return NULL for tests.
- if (!g_browser_process->local_state())
- return false;
-
- return !g_browser_process->local_state()->FindPreference(
- prefs::kAllowFileSelectionDialogs) ||
- g_browser_process->local_state()->GetBoolean(
- prefs::kAllowFileSelectionDialogs);
-}
-
-void ChromeSelectFilePolicy::SelectFileDenied() {
- // Show the InfoBar saying that file-selection dialogs are disabled.
- if (source_contents_) {
- TabContents* tab_contents = TabContents::FromWebContents(source_contents_);
- DCHECK(tab_contents);
- InfoBarTabHelper* infobar_helper = tab_contents->infobar_tab_helper();
- infobar_helper->AddInfoBar(new SimpleAlertInfoBarDelegate(
- infobar_helper,
- NULL,
- l10n_util::GetStringUTF16(IDS_FILE_SELECTION_DIALOG_INFOBAR),
- true));
- } else {
- LOG(WARNING) << "File-selection dialogs are disabled but no WebContents "
- << "is given to display the InfoBar.";
- }
-}
« no previous file with comments | « chrome/browser/ui/chrome_select_file_policy.h ('k') | chrome/browser/ui/chrome_select_file_policy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698