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

Unified Diff: chrome_frame/turndown_prompt/turndown_prompt_content.cc

Issue 17153006: Chrome Frame turndown prompt. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase to r207907 Created 7 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_frame/turndown_prompt/turndown_prompt_content.cc
diff --git a/chrome_frame/ready_mode/internal/ready_prompt_content.cc b/chrome_frame/turndown_prompt/turndown_prompt_content.cc
similarity index 58%
copy from chrome_frame/ready_mode/internal/ready_prompt_content.cc
copy to chrome_frame/turndown_prompt/turndown_prompt_content.cc
index 52ab70fe019467d7a3bb3fa33f5592b6dd9e1324..8b58b50ac76c3bafc17b494fa046167dd01aa4f8 100644
--- a/chrome_frame/ready_mode/internal/ready_prompt_content.cc
+++ b/chrome_frame/turndown_prompt/turndown_prompt_content.cc
@@ -1,21 +1,21 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright 2013 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_frame/ready_mode/internal/ready_prompt_content.h"
+#include "chrome_frame/turndown_prompt/turndown_prompt_content.h"
#include "base/logging.h"
-#include "chrome_frame/ready_mode/internal/ready_mode_state.h"
-#include "chrome_frame/ready_mode/internal/ready_prompt_window.h"
#include "chrome_frame/ready_mode/internal/url_launcher.h"
+#include "chrome_frame/turndown_prompt/turndown_prompt_window.h"
-ReadyPromptContent::ReadyPromptContent(ReadyModeState* ready_mode_state,
- UrlLauncher* url_launcher)
- : ready_mode_state_(ready_mode_state),
- url_launcher_(url_launcher) {
+TurndownPromptContent::TurndownPromptContent(
+ UrlLauncher* url_launcher,
+ const base::Closure& uninstall_closure)
+ : url_launcher_(url_launcher),
+ uninstall_closure_(uninstall_closure) {
}
-ReadyPromptContent::~ReadyPromptContent() {
+TurndownPromptContent::~TurndownPromptContent() {
if (window_ != NULL && window_->IsWindow()) {
// The window must discard its ContentFrame pointer at this time.
window_->DestroyWindow();
@@ -23,19 +23,19 @@ ReadyPromptContent::~ReadyPromptContent() {
}
}
-bool ReadyPromptContent::InstallInFrame(Frame* frame) {
+bool TurndownPromptContent::InstallInFrame(Frame* frame) {
DCHECK(window_ == NULL);
- DCHECK(ready_mode_state_ != NULL);
DCHECK(url_launcher_ != NULL);
- // Pass ownership of our ready_mode_state_ and url_launcher_ to the window.
- window_ = ReadyPromptWindow::CreateInstance(
- frame, ready_mode_state_.release(), url_launcher_.release());
+ // Pass ownership of our url_launcher_ to the window.
+ window_ = TurndownPromptWindow::CreateInstance(
+ frame, url_launcher_.release(), uninstall_closure_);
+ uninstall_closure_.Reset();
return window_ != NULL;
}
-void ReadyPromptContent::SetDimensions(const RECT& dimensions) {
+void TurndownPromptContent::SetDimensions(const RECT& dimensions) {
if (window_ != NULL && window_->IsWindow()) {
window_->SetWindowPos(HWND_TOP, &dimensions,
::IsRectEmpty(&dimensions) ? SWP_HIDEWINDOW :
@@ -43,9 +43,10 @@ void ReadyPromptContent::SetDimensions(const RECT& dimensions) {
}
}
-bool GetDialogTemplateDimensions(ReadyPromptWindow* window, RECT* dimensions) {
+bool GetDialogTemplateDimensions(TurndownPromptWindow* window,
+ RECT* dimensions) {
HRSRC resource = ::FindResource(_AtlBaseModule.GetResourceInstance(),
- MAKEINTRESOURCE(ReadyPromptWindow::IDD),
+ MAKEINTRESOURCE(TurndownPromptWindow::IDD),
RT_DIALOG);
HGLOBAL handle = NULL;
@@ -53,25 +54,25 @@ bool GetDialogTemplateDimensions(ReadyPromptWindow* window, RECT* dimensions) {
_DialogSplitHelper::DLGTEMPLATEEX* dlgtemplateex = NULL;
if (resource == NULL) {
- DPLOG(ERROR) << "Failed to find resource for ReadyPromptWindow::IDD";
+ DPLOG(ERROR) << "Failed to find resource for TurndownPromptWindow::IDD";
return false;
}
handle = ::LoadResource(_AtlBaseModule.GetResourceInstance(), resource);
if (handle == NULL) {
- DPLOG(ERROR) << "Failed to load resource for ReadyPromptWindow::IDD";
+ DPLOG(ERROR) << "Failed to load resource for TurndownPromptWindow::IDD";
return false;
}
dlgtemplate = reinterpret_cast<DLGTEMPLATE*>(::LockResource(handle));
if (dlgtemplate == NULL) {
- DPLOG(ERROR) << "Failed to lock resource for ReadyPromptWindow::IDD";
+ DPLOG(ERROR) << "Failed to lock resource for TurndownPromptWindow::IDD";
return false;
}
if (!_DialogSplitHelper::IsDialogEx(dlgtemplate)) {
- DLOG(ERROR) << "Resource ReadyPromptWindow::IDD is not a DLGTEMPLATEEX";
+ DLOG(ERROR) << "Resource TurndownPromptWindow::IDD is not a DLGTEMPLATEEX";
return false;
}
@@ -88,7 +89,7 @@ bool GetDialogTemplateDimensions(ReadyPromptWindow* window, RECT* dimensions) {
return true;
}
-size_t ReadyPromptContent::GetDesiredSize(size_t width, size_t height) {
+size_t TurndownPromptContent::GetDesiredSize(size_t width, size_t height) {
DCHECK(window_ != NULL && window_->IsWindow());
if (window_ == NULL || !window_->IsWindow()) {

Powered by Google App Engine
This is Rietveld 408576698