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

Side by Side Diff: chrome/browser/devtools/devtools_window.cc

Issue 190063006: Infobar Componentization Proof of Concept (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor fixes Created 6 years, 9 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
OLDNEW
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 #include "chrome/browser/devtools/devtools_window.h" 5 #include "chrome/browser/devtools/devtools_window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
11 #include "base/json/json_writer.h" 11 #include "base/json/json_writer.h"
12 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
13 #include "base/metrics/histogram.h" 13 #include "base/metrics/histogram.h"
14 #include "base/prefs/scoped_user_pref_update.h" 14 #include "base/prefs/scoped_user_pref_update.h"
15 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
16 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
17 #include "base/strings/utf_string_conversions.h" 17 #include "base/strings/utf_string_conversions.h"
18 #include "base/time/time.h" 18 #include "base/time/time.h"
19 #include "base/values.h" 19 #include "base/values.h"
20 #include "chrome/browser/browser_process.h" 20 #include "chrome/browser/browser_process.h"
21 #include "chrome/browser/chrome_notification_types.h" 21 #include "chrome/browser/chrome_notification_types.h"
22 #include "chrome/browser/chrome_page_zoom.h" 22 #include "chrome/browser/chrome_page_zoom.h"
23 #include "chrome/browser/extensions/api/debugger/debugger_api.h" 23 #include "chrome/browser/extensions/api/debugger/debugger_api.h"
24 #include "chrome/browser/extensions/extension_service.h" 24 #include "chrome/browser/extensions/extension_service.h"
25 #include "chrome/browser/extensions/extension_web_contents_observer.h" 25 #include "chrome/browser/extensions/extension_web_contents_observer.h"
26 #include "chrome/browser/file_select_helper.h" 26 #include "chrome/browser/file_select_helper.h"
27 #include "chrome/browser/infobars/confirm_infobar_delegate.h" 27 #include "chrome/browser/infobars/confirm_infobar_delegate.h"
28 #include "chrome/browser/infobars/infobar.h" 28 #include "chrome/browser/infobars/infobar.h"
29 #include "chrome/browser/infobars/infobar_manager.h"
30 #include "chrome/browser/infobars/infobar_service.h"
29 #include "chrome/browser/prefs/pref_service_syncable.h" 31 #include "chrome/browser/prefs/pref_service_syncable.h"
30 #include "chrome/browser/profiles/profile.h" 32 #include "chrome/browser/profiles/profile.h"
31 #include "chrome/browser/sessions/session_tab_helper.h" 33 #include "chrome/browser/sessions/session_tab_helper.h"
32 #include "chrome/browser/themes/theme_properties.h" 34 #include "chrome/browser/themes/theme_properties.h"
33 #include "chrome/browser/themes/theme_service.h" 35 #include "chrome/browser/themes/theme_service.h"
34 #include "chrome/browser/themes/theme_service_factory.h" 36 #include "chrome/browser/themes/theme_service_factory.h"
35 #include "chrome/browser/ui/browser.h" 37 #include "chrome/browser/ui/browser.h"
36 #include "chrome/browser/ui/browser_dialogs.h" 38 #include "chrome/browser/ui/browser_dialogs.h"
37 #include "chrome/browser/ui/browser_iterator.h" 39 #include "chrome/browser/ui/browser_iterator.h"
38 #include "chrome/browser/ui/browser_list.h" 40 #include "chrome/browser/ui/browser_list.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 113
112 void DevToolsConfirmInfoBarDelegate::Create( 114 void DevToolsConfirmInfoBarDelegate::Create(
113 InfoBarService* infobar_service, 115 InfoBarService* infobar_service,
114 const DevToolsWindow::InfoBarCallback& callback, 116 const DevToolsWindow::InfoBarCallback& callback,
115 const base::string16& message) { 117 const base::string16& message) {
116 if (!infobar_service) { 118 if (!infobar_service) {
117 callback.Run(false); 119 callback.Run(false);
118 return; 120 return;
119 } 121 }
120 122
121 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( 123 infobar_service->AddInfoBar(
122 scoped_ptr<ConfirmInfoBarDelegate>( 124 ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>(
123 new DevToolsConfirmInfoBarDelegate(callback, message)))); 125 new DevToolsConfirmInfoBarDelegate(callback, message))));
124 } 126 }
125 127
126 DevToolsConfirmInfoBarDelegate::DevToolsConfirmInfoBarDelegate( 128 DevToolsConfirmInfoBarDelegate::DevToolsConfirmInfoBarDelegate(
127 const DevToolsWindow::InfoBarCallback& callback, 129 const DevToolsWindow::InfoBarCallback& callback,
128 const base::string16& message) 130 const base::string16& message)
129 : ConfirmInfoBarDelegate(), 131 : ConfirmInfoBarDelegate(),
130 callback_(callback), 132 callback_(callback),
131 message_(message) { 133 message_(message) {
132 } 134 }
(...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 } 1536 }
1535 1537
1536 void DevToolsWindow::SetLoadCompletedCallback(const base::Closure& closure) { 1538 void DevToolsWindow::SetLoadCompletedCallback(const base::Closure& closure) {
1537 if (load_state_ == kLoadCompleted) { 1539 if (load_state_ == kLoadCompleted) {
1538 if (!closure.is_null()) 1540 if (!closure.is_null())
1539 closure.Run(); 1541 closure.Run();
1540 return; 1542 return;
1541 } 1543 }
1542 load_completed_callback_ = closure; 1544 load_completed_callback_ = closure;
1543 } 1545 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698