| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import <Carbon/Carbon.h> | 5 #import <Carbon/Carbon.h> |
| 6 #import <Cocoa/Cocoa.h> | 6 #import <Cocoa/Cocoa.h> |
| 7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
| 8 #import <Foundation/NSAppleEventDescriptor.h> | 8 #import <Foundation/NSAppleEventDescriptor.h> |
| 9 #import <objc/message.h> | 9 #import <objc/message.h> |
| 10 #import <objc/runtime.h> | 10 #import <objc/runtime.h> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #include "components/bookmarks/browser/bookmark_model.h" | 41 #include "components/bookmarks/browser/bookmark_model.h" |
| 42 #include "components/bookmarks/test/bookmark_test_helpers.h" | 42 #include "components/bookmarks/test/bookmark_test_helpers.h" |
| 43 #include "components/signin/core/common/profile_management_switches.h" | 43 #include "components/signin/core/common/profile_management_switches.h" |
| 44 #include "content/public/browser/web_contents.h" | 44 #include "content/public/browser/web_contents.h" |
| 45 #include "content/public/test/browser_test_utils.h" | 45 #include "content/public/test/browser_test_utils.h" |
| 46 #include "content/public/test/test_navigation_observer.h" | 46 #include "content/public/test/test_navigation_observer.h" |
| 47 #include "extensions/browser/app_window/app_window_registry.h" | 47 #include "extensions/browser/app_window/app_window_registry.h" |
| 48 #include "extensions/common/extension.h" | 48 #include "extensions/common/extension.h" |
| 49 #include "extensions/test/extension_test_message_listener.h" | 49 #include "extensions/test/extension_test_message_listener.h" |
| 50 #include "net/test/embedded_test_server/embedded_test_server.h" | 50 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 51 #include "ui/gfx/host_desktop_type.h" |
| 51 | 52 |
| 52 namespace { | 53 namespace { |
| 53 | 54 |
| 54 GURL g_open_shortcut_url = GURL::EmptyGURL(); | 55 GURL g_open_shortcut_url = GURL::EmptyGURL(); |
| 55 | 56 |
| 56 // Returns an Apple Event that instructs the application to open |url|. | 57 // Returns an Apple Event that instructs the application to open |url|. |
| 57 NSAppleEventDescriptor* AppleEventToOpenUrl(const GURL& url) { | 58 NSAppleEventDescriptor* AppleEventToOpenUrl(const GURL& url) { |
| 58 NSAppleEventDescriptor* shortcut_event = [[[NSAppleEventDescriptor alloc] | 59 NSAppleEventDescriptor* shortcut_event = [[[NSAppleEventDescriptor alloc] |
| 59 initWithEventClass:kASAppleScriptSuite | 60 initWithEventClass:kASAppleScriptSuite |
| 60 eventID:kASSubroutineEvent | 61 eventID:kASSubroutineEvent |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 ui_test_utils::NavigateToURL(browser3, test_url1); | 692 ui_test_utils::NavigateToURL(browser3, test_url1); |
| 692 EXPECT_EQ(g_handoff_url, GURL()); | 693 EXPECT_EQ(g_handoff_url, GURL()); |
| 693 | 694 |
| 694 // Activate the original browser window. | 695 // Activate the original browser window. |
| 695 Browser* browser1 = active_browser_list->get(0); | 696 Browser* browser1 = active_browser_list->get(0); |
| 696 browser1->window()->Show(); | 697 browser1->window()->Show(); |
| 697 EXPECT_EQ(g_handoff_url, test_url2); | 698 EXPECT_EQ(g_handoff_url, test_url2); |
| 698 } | 699 } |
| 699 | 700 |
| 700 } // namespace | 701 } // namespace |
| OLD | NEW |