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

Side by Side Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc

Issue 16702003: Move ShellWindow into apps component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: yar Created 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" 5 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "apps/shell_window.h"
11 #include "base/base64.h" 12 #include "base/base64.h"
12 #include "base/bind.h" 13 #include "base/bind.h"
13 #include "base/i18n/rtl.h" 14 #include "base/i18n/rtl.h"
14 #include "base/logging.h" 15 #include "base/logging.h"
15 #include "base/prefs/pref_service.h" 16 #include "base/prefs/pref_service.h"
16 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.h"
17 #include "base/strings/string_split.h" 18 #include "base/strings/string_split.h"
18 #include "base/strings/string_util.h" 19 #include "base/strings/string_util.h"
19 #include "base/strings/utf_string_conversions.h" 20 #include "base/strings/utf_string_conversions.h"
20 #include "base/time/time.h" 21 #include "base/time/time.h"
21 #include "chrome/browser/autofill/personal_data_manager_factory.h" 22 #include "chrome/browser/autofill/personal_data_manager_factory.h"
22 #include "chrome/browser/browser_process.h" 23 #include "chrome/browser/browser_process.h"
23 #include "chrome/browser/extensions/shell_window_registry.h" 24 #include "chrome/browser/extensions/shell_window_registry.h"
24 #include "chrome/browser/prefs/scoped_user_pref_update.h" 25 #include "chrome/browser/prefs/scoped_user_pref_update.h"
25 #include "chrome/browser/profiles/profile.h" 26 #include "chrome/browser/profiles/profile.h"
26 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" 27 #include "chrome/browser/ui/autofill/autofill_dialog_view.h"
27 #include "chrome/browser/ui/autofill/data_model_wrapper.h" 28 #include "chrome/browser/ui/autofill/data_model_wrapper.h"
28 #include "chrome/browser/ui/browser.h" 29 #include "chrome/browser/ui/browser.h"
29 #include "chrome/browser/ui/browser_finder.h" 30 #include "chrome/browser/ui/browser_finder.h"
30 #include "chrome/browser/ui/browser_navigator.h" 31 #include "chrome/browser/ui/browser_navigator.h"
31 #include "chrome/browser/ui/browser_window.h" 32 #include "chrome/browser/ui/browser_window.h"
32 #include "chrome/browser/ui/extensions/native_app_window.h" 33 #include "chrome/browser/ui/extensions/native_app_window.h"
33 #include "chrome/browser/ui/extensions/shell_window.h"
34 #include "chrome/common/chrome_version_info.h" 34 #include "chrome/common/chrome_version_info.h"
35 #include "chrome/common/pref_names.h" 35 #include "chrome/common/pref_names.h"
36 #include "chrome/common/url_constants.h" 36 #include "chrome/common/url_constants.h"
37 #include "components/autofill/content/browser/risk/fingerprint.h" 37 #include "components/autofill/content/browser/risk/fingerprint.h"
38 #include "components/autofill/content/browser/risk/proto/fingerprint.pb.h" 38 #include "components/autofill/content/browser/risk/proto/fingerprint.pb.h"
39 #include "components/autofill/content/browser/wallet/form_field_error.h" 39 #include "components/autofill/content/browser/wallet/form_field_error.h"
40 #include "components/autofill/content/browser/wallet/full_wallet.h" 40 #include "components/autofill/content/browser/wallet/full_wallet.h"
41 #include "components/autofill/content/browser/wallet/instrument.h" 41 #include "components/autofill/content/browser/wallet/instrument.h"
42 #include "components/autofill/content/browser/wallet/wallet_address.h" 42 #include "components/autofill/content/browser/wallet/wallet_address.h"
43 #include "components/autofill/content/browser/wallet/wallet_items.h" 43 #include "components/autofill/content/browser/wallet/wallet_items.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 // window might be a browser window for a Chrome tab, or it might be a shell 219 // window might be a browser window for a Chrome tab, or it might be a shell
220 // window for a platform app. 220 // window for a platform app.
221 ui::BaseWindow* GetBaseWindowForWebContents( 221 ui::BaseWindow* GetBaseWindowForWebContents(
222 const content::WebContents* web_contents) { 222 const content::WebContents* web_contents) {
223 Browser* browser = chrome::FindBrowserWithWebContents(web_contents); 223 Browser* browser = chrome::FindBrowserWithWebContents(web_contents);
224 if (browser) 224 if (browser)
225 return browser->window(); 225 return browser->window();
226 226
227 gfx::NativeWindow native_window = 227 gfx::NativeWindow native_window =
228 web_contents->GetView()->GetTopLevelNativeWindow(); 228 web_contents->GetView()->GetTopLevelNativeWindow();
229 ShellWindow* shell_window = 229 apps::ShellWindow* shell_window =
230 extensions::ShellWindowRegistry:: 230 extensions::ShellWindowRegistry::
231 GetShellWindowForNativeWindowAnyProfile(native_window); 231 GetShellWindowForNativeWindowAnyProfile(native_window);
232 return shell_window->GetBaseWindow(); 232 return shell_window->GetBaseWindow();
233 } 233 }
234 234
235 // Extracts the string value of a field with |type| from |output|. This is 235 // Extracts the string value of a field with |type| from |output|. This is
236 // useful when you only need the value of 1 input from a section of view inputs. 236 // useful when you only need the value of 1 input from a section of view inputs.
237 string16 GetValueForType(const DetailOutputMap& output, 237 string16 GetValueForType(const DetailOutputMap& output,
238 AutofillFieldType type) { 238 AutofillFieldType type) {
239 for (DetailOutputMap::const_iterator it = output.begin(); 239 for (DetailOutputMap::const_iterator it = output.begin();
(...skipping 3047 matching lines...) Expand 10 before | Expand all | Expand 10 after
3287 AutofillMetrics::DIALOG_USER_SIGNED_IN_NO_WALLET_NO_AUTOFILL; 3287 AutofillMetrics::DIALOG_USER_SIGNED_IN_NO_WALLET_NO_AUTOFILL;
3288 } 3288 }
3289 3289
3290 // Has Wallet items. 3290 // Has Wallet items.
3291 return has_autofill_profiles ? 3291 return has_autofill_profiles ?
3292 AutofillMetrics::DIALOG_USER_SIGNED_IN_HAS_WALLET_HAS_AUTOFILL : 3292 AutofillMetrics::DIALOG_USER_SIGNED_IN_HAS_WALLET_HAS_AUTOFILL :
3293 AutofillMetrics::DIALOG_USER_SIGNED_IN_HAS_WALLET_NO_AUTOFILL; 3293 AutofillMetrics::DIALOG_USER_SIGNED_IN_HAS_WALLET_NO_AUTOFILL;
3294 } 3294 }
3295 3295
3296 } // namespace autofill 3296 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698