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

Unified Diff: chrome/browser/ui/cocoa/intents/web_intent_picker_cocoa.mm

Issue 11414153: Remove legacy constrained window dialogs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/cocoa/intents/web_intent_picker_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/intents/web_intent_picker_cocoa2.mm b/chrome/browser/ui/cocoa/intents/web_intent_picker_cocoa.mm
similarity index 64%
rename from chrome/browser/ui/cocoa/intents/web_intent_picker_cocoa2.mm
rename to chrome/browser/ui/cocoa/intents/web_intent_picker_cocoa.mm
index 16be6945993215f219adc423e66afcd79795b39e..29c025322ba00d5e0d604641b6d26b5600880ef8 100644
--- a/chrome/browser/ui/cocoa/intents/web_intent_picker_cocoa2.mm
+++ b/chrome/browser/ui/cocoa/intents/web_intent_picker_cocoa.mm
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#import "chrome/browser/ui/cocoa/intents/web_intent_picker_cocoa2.h"
+#import "chrome/browser/ui/cocoa/intents/web_intent_picker_cocoa.h"
#include <Cocoa/Cocoa.h>
@@ -16,9 +16,16 @@
#include "chrome/browser/ui/tab_contents/tab_contents.h"
#include "content/public/browser/native_web_keyboard_event.h"
-WebIntentPickerCocoa2::WebIntentPickerCocoa2(content::WebContents* web_contents,
- WebIntentPickerDelegate* delegate,
- WebIntentPickerModel* model)
+// static
+WebIntentPicker* WebIntentPicker::Create(content::WebContents* web_contents,
+ WebIntentPickerDelegate* delegate,
+ WebIntentPickerModel* model) {
+ return new WebIntentPickerCocoa(web_contents, delegate, model);
+}
+
+WebIntentPickerCocoa::WebIntentPickerCocoa(content::WebContents* web_contents,
+ WebIntentPickerDelegate* delegate,
+ WebIntentPickerModel* model)
: web_contents_(web_contents),
delegate_(delegate),
model_(model),
@@ -38,38 +45,38 @@ WebIntentPickerCocoa2::WebIntentPickerCocoa2(content::WebContents* web_contents,
this, web_contents, window));
}
-WebIntentPickerCocoa2::~WebIntentPickerCocoa2() {
+WebIntentPickerCocoa::~WebIntentPickerCocoa() {
}
-void WebIntentPickerCocoa2::Close() {
+void WebIntentPickerCocoa::Close() {
constrained_window_->CloseConstrainedWindow();
}
-void WebIntentPickerCocoa2::SetActionString(const string16& action) {
+void WebIntentPickerCocoa::SetActionString(const string16& action) {
// Ignored. Action string is retrieved from the model.
}
-void WebIntentPickerCocoa2::OnExtensionInstallSuccess(const std::string& id) {
+void WebIntentPickerCocoa::OnExtensionInstallSuccess(const std::string& id) {
ScheduleUpdate();
}
-void WebIntentPickerCocoa2::OnExtensionInstallFailure(const std::string& id) {
+void WebIntentPickerCocoa::OnExtensionInstallFailure(const std::string& id) {
ScheduleUpdate();
}
-void WebIntentPickerCocoa2::OnShowExtensionInstallDialog(
+void WebIntentPickerCocoa::OnShowExtensionInstallDialog(
content::WebContents* parent_web_contents,
ExtensionInstallPrompt::Delegate* delegate,
const ExtensionInstallPrompt::Prompt& prompt) {
ScheduleUpdate();
}
-void WebIntentPickerCocoa2::OnInlineDispositionAutoResize(
+void WebIntentPickerCocoa::OnInlineDispositionAutoResize(
const gfx::Size& size) {
ScheduleUpdate();
}
-void WebIntentPickerCocoa2::OnInlineDispositionHandleKeyboardEvent(
+void WebIntentPickerCocoa::OnInlineDispositionHandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) {
if (event.skip_in_browser ||
event.type == content::NativeWebKeyboardEvent::Char) {
@@ -81,44 +88,44 @@ void WebIntentPickerCocoa2::OnInlineDispositionHandleKeyboardEvent(
[window redispatchKeyEvent:event.os_event];
}
-void WebIntentPickerCocoa2::OnPendingAsyncCompleted() {
+void WebIntentPickerCocoa::OnPendingAsyncCompleted() {
ScheduleUpdate();
}
-void WebIntentPickerCocoa2::InvalidateDelegate() {
+void WebIntentPickerCocoa::InvalidateDelegate() {
delegate_ = NULL;
}
-void WebIntentPickerCocoa2::OnInlineDispositionWebContentsLoaded(
+void WebIntentPickerCocoa::OnInlineDispositionWebContentsLoaded(
content::WebContents* web_contents) {
ScheduleUpdate();
}
-gfx::Size WebIntentPickerCocoa2::GetMinInlineDispositionSize() {
+gfx::Size WebIntentPickerCocoa::GetMinInlineDispositionSize() {
return [view_controller_ minimumInlineWebViewSize];
}
-void WebIntentPickerCocoa2::OnModelChanged(WebIntentPickerModel* model) {
+void WebIntentPickerCocoa::OnModelChanged(WebIntentPickerModel* model) {
ScheduleUpdate();
}
-void WebIntentPickerCocoa2::OnFaviconChanged(WebIntentPickerModel* model,
+void WebIntentPickerCocoa::OnFaviconChanged(WebIntentPickerModel* model,
size_t index) {
ScheduleUpdate();
}
-void WebIntentPickerCocoa2::OnExtensionIconChanged(
+void WebIntentPickerCocoa::OnExtensionIconChanged(
WebIntentPickerModel* model,
const std::string& extension_id) {
ScheduleUpdate();
}
-void WebIntentPickerCocoa2::OnInlineDisposition(const string16& title,
+void WebIntentPickerCocoa::OnInlineDisposition(const string16& title,
const GURL& url) {
ScheduleUpdate();
}
-void WebIntentPickerCocoa2::OnConstrainedWindowClosed(
+void WebIntentPickerCocoa::OnConstrainedWindowClosed(
ConstrainedWindowMac2* window) {
// After the OnClosing call the model may be deleted so unset this reference.
model_->set_observer(NULL);
@@ -130,17 +137,17 @@ void WebIntentPickerCocoa2::OnConstrainedWindowClosed(
MessageLoop::current()->DeleteSoon(FROM_HERE, this);
}
-void WebIntentPickerCocoa2::ScheduleUpdate() {
+void WebIntentPickerCocoa::ScheduleUpdate() {
if (update_pending_)
return;
update_pending_ = true;
MessageLoop::current()->PostTask(
FROM_HERE,
- base::Bind(&WebIntentPickerCocoa2::PerformUpdate,
+ base::Bind(&WebIntentPickerCocoa::PerformUpdate,
weak_ptr_factory_.GetWeakPtr()));
}
-void WebIntentPickerCocoa2::PerformUpdate() {
+void WebIntentPickerCocoa::PerformUpdate() {
update_pending_ = false;
[view_controller_ update];
}
« no previous file with comments | « chrome/browser/ui/cocoa/intents/web_intent_picker_cocoa.h ('k') | chrome/browser/ui/cocoa/intents/web_intent_picker_cocoa2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698