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

Unified Diff: chrome/browser/extensions/extension_infobar_module.cc

Issue 8374024: Move infobar extension API implementation to infobars dir. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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/extensions/extension_infobar_module.cc
diff --git a/chrome/browser/extensions/extension_infobar_module.cc b/chrome/browser/extensions/extension_infobar_module.cc
deleted file mode 100644
index 0032207c268cef7894e5a6e56cddc765ce16dd00..0000000000000000000000000000000000000000
--- a/chrome/browser/extensions/extension_infobar_module.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2011 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/extensions/extension_infobar_module.h"
-
-#include "base/string_number_conversions.h"
-#include "base/string_util.h"
-#include "base/values.h"
-#include "chrome/browser/extensions/extension_host.h"
-#include "chrome/browser/extensions/extension_infobar_delegate.h"
-#include "chrome/browser/extensions/extension_infobar_module_constants.h"
-#include "chrome/browser/extensions/extension_tab_util.h"
-#include "chrome/browser/extensions/extension_tabs_module_constants.h"
-#include "chrome/browser/infobars/infobar_tab_helper.h"
-#include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
-#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_error_utils.h"
-#include "chrome/common/url_constants.h"
-#include "content/browser/tab_contents/tab_contents.h"
-#include "grit/generated_resources.h"
-
-namespace keys = extension_infobar_module_constants;
-
-bool ShowInfoBarFunction::RunImpl() {
- DictionaryValue* args;
- EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &args));
-
- int tab_id;
- EXTENSION_FUNCTION_VALIDATE(args->GetInteger(keys::kTabId, &tab_id));
-
- std::string html_path;
- EXTENSION_FUNCTION_VALIDATE(args->GetString(keys::kHtmlPath, &html_path));
-
- int height = 0;
- if (args->HasKey(keys::kHeight))
- EXTENSION_FUNCTION_VALIDATE(args->GetInteger(keys::kHeight, &height));
-
- const Extension* extension = GetExtension();
- GURL url = extension->GetResourceURL(extension->url(), html_path);
-
- Browser* browser = NULL;
- TabContentsWrapper* tab_contents = NULL;
- if (!ExtensionTabUtil::GetTabById(
- tab_id,
- profile(),
- include_incognito(),
- &browser,
- NULL,
- &tab_contents,
- NULL)) {
- error_ = ExtensionErrorUtils::FormatErrorMessage(
- extension_tabs_module_constants::kTabNotFoundError,
- base::IntToString(tab_id));
- return false;
- }
-
- tab_contents->infobar_tab_helper()->AddInfoBar(
- new ExtensionInfoBarDelegate(browser, tab_contents->infobar_tab_helper(),
- GetExtension(), url, height));
-
- // TODO(finnur): Return the actual DOMWindow object. Bug 26463.
- result_.reset(ExtensionTabUtil::CreateWindowValue(browser, false));
-
- return true;
-}
« no previous file with comments | « chrome/browser/extensions/extension_infobar_module.h ('k') | chrome/browser/extensions/extension_infobar_module_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698