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

Side by Side Diff: webkit/glue/window_open_disposition.cc

Issue 149620: Use WebWidget from the WebKit API. This change also makes... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "webkit/glue/window_open_disposition.h"
6
7 #include "base/logging.h"
8
9 // The macro dance here allows us to only express the mapping once.
10 #define MAPPINGS(MAP) \
11 MAP(WebNavigationPolicyIgnore, IGNORE_ACTION) \
12 MAP(WebNavigationPolicyDownload, SAVE_TO_DISK) \
13 MAP(WebNavigationPolicyCurrentTab, CURRENT_TAB) \
14 MAP(WebNavigationPolicyNewBackgroundTab, NEW_BACKGROUND_TAB) \
15 MAP(WebNavigationPolicyNewForegroundTab, NEW_FOREGROUND_TAB) \
16 MAP(WebNavigationPolicyNewWindow, NEW_WINDOW) \
17 MAP(WebNavigationPolicyNewPopup, NEW_POPUP)
18
19 #define POLICY_TO_DISPOSITION(policy, disposition) \
20 case WebKit::policy: return disposition;
21
22 WindowOpenDisposition NavigationPolicyToDisposition(
23 WebKit::WebNavigationPolicy policy) {
24 switch (policy) {
25 MAPPINGS(POLICY_TO_DISPOSITION)
26 default:
27 NOTREACHED() << "Unexpected WebNavigationPolicy";
28 return IGNORE_ACTION;
29 }
30 }
31
32 #define DISPOSITION_TO_POLICY(policy, disposition) \
33 case disposition: return WebKit::policy;
34
35 WebKit::WebNavigationPolicy DispositionToNavigationPolicy(
36 WindowOpenDisposition disposition) {
37 switch (disposition) {
38 MAPPINGS(DISPOSITION_TO_POLICY)
39 default:
40 NOTREACHED() << "Unexpected WindowOpenDisposition";
41 return WebKit::WebNavigationPolicyIgnore;
42 }
43 }
OLDNEW
« no previous file with comments | « webkit/glue/window_open_disposition.h ('k') | webkit/tools/test_shell/event_sending_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698